Question Most Common
You are given a custom list of maps in Appian, where each map contains fields like name and id. Some of the name values are either null or empty strings. How would you remove the entries that have a null or empty name field using Appian expressions?
A
Anonymous
November 8, 2025

Answer

This expression

  1. local!data holds a list of employee records — each with an id and name. Some names are null.
  2. Using a!forEach, the expression loops through each record (fv!item):
  3. If the name is not null or empty, it returns the entire record.
  4. Otherwise, it returns an empty string ("").
  5. The reject(fn!isnull, …) function removes those empty values from the list.

Code:

a!localVariables(
local!data: {
a!map(id: 1, name: "Ram"),
a!map(id: 2, name: null()),
a!map(id: 3, name: "Sita"),
a!map(id: 4, name: null()),
a!map(id: 5, name: "Hanuman")
},
reject(
fn!isnull,
a!forEach(
items: local!data,
expression: {
if(
a!isNotNullOrEmpty(fv!item.name),
fv!item,
""
)
}
)
)
)

Output:

1762634497232-i79kxovvijg.png


JuniorSeniorExpressions#sailcoding#coding
Loading comments...