Skip to main content
3/7

not(): flip every flag in a list

Easy

Return the list with every value flipped: true becomes false and false becomes true.

A list in gives a list of the same length out. No loop is needed.

Input

  • ri!flags: List of Boolean

ri! Rule Inputs

ri!flagsList of Boolean
{
  true,
  false,
  true
}

Example 1: Mixed

Input: ri!flags
{
  true,
  false,
  true
}
Expected output:
{
  false,
  true,
  false
}

Example 2: One value

Input: ri!flags
{false}
Expected output:
{true}

Example 3: All true

Input: ri!flags
{
  true,
  true
}
Expected output:
{
  false,
  false
}

Example 4: Empty list

Input: ri!flags
{}
Expected output:
{}

Appian Expression Tips

  • • Use ri!variableName for 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