reject(): drop blanks as well as nulls
Easy
Return the entries with both nulls and empty text removed.
fn!isnull is not enough here: an empty piece of text is not null, and it has to go too.
Input
ri!entries: List of Text
ri! Rule Inputs
ri!entriesList of Text{
"a",
"",
null,
"b"
}Example 1: A blank and a null
Input: ri!entries
{
"a",
"",
null,
"b"
}Expected output:
{
"a",
"b"
}Example 2: Nothing worth keeping
Input: ri!entries
{
"",
null
}Expected output:
{}Example 3: All real entries
Input: ri!entries
{
"x",
"y"
}Expected output:
{
"x",
"y"
}Example 4: Only blanks
Input: ri!entries
{
"",
""
}Expected output:
{}Appian Expression Tips
- • Use
ri!variableNamefor rule inputs - • Use
a!localVariables(local!x: …, body)for locals - • Use
a!forEach(items: …, expression: fv!item)to iterate - • Use
where()/reject(fn!isnull, list)to filter