Question
In Appian, how would you generate a list of numbers from 1 to 500, and then display only every 100th number (i.e., 100, 200, 300, 400, 500) from that list using Appian expressions?
A
Anonymous
November 8, 2025

Answer

This expression is written using Appian SAIL syntax with a!localVariables, a!forEach, and reject() functions.

Let’s break it down step by step:

Define local variables

local!data: enumerate(500) + 1
  1. enumerate(500) generates a list of numbers starting from 0 to 499.
  2. Adding + 1 shifts the entire list by one, so now local!data becomes:
{1, 2, 3, ..., 500}

Iterate through the list using a!forEach

a!forEach(
items: local!data,
expression: if(mod(fv!item, 100) = 0, fv!item, "")
)
  1. a!forEach loops over each number in the list.
  2. For each item (fv!item):
  3. It checks if the number is divisible by 100 using mod(fv!item, 100) = 0.
  4. If true, it returns that number.
  5. If false, it returns an empty string ("").

So the intermediate result looks like:

{"", "", ..., 100, "", "", ..., 200, "", ..., 300, "", ..., 400, "", ..., 500}

Remove null/empty values using reject()

reject(fn!isnull, ...)
  1. reject() filters out unwanted items from the list.
  2. fn!isnull checks for null or empty values.
  3. So only the non-null values (i.e., 100, 200, 300, 400, 500) remain.

Final Code

a!localVariables(
local!data: enumerate(500) + 1,
reject(
fn!isnull,
a!forEach(
items: local!data,
expression: if(mod(fv!item, 100) = 0, fv!item, "")
)
)
)

Final Output

{100, 200, 300, 400, 500}


JuniorExpressions#coding#sailcoding
Loading comments...