2/5

a!map(): list the fields a record has

Easy

Return the field names of the record, as a list of text.

A record with no fields has no field names.

Input

  • ri!record — Map

ri! Rule Inputs

ri!recordMap
a!map(name: "Ann", age: 30)

Example 1 — Two fields

Input: ri!record
a!map(name: "Ann", age: 30)
Output:
{
  "name",
  "age"
}

Example 2 — One field

Input: ri!record
a!map(city: "Pune")
Output:
{"city"}

Example 3 — An empty record

Input: ri!record
a!map()
Output:
{}

Example 4 — Three fields keep their order

Input: ri!record
a!map(a: 1, b: 2, c: 3)
Output:
{
  "a",
  "b",
  "c"
}

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