Skip to content

Keyword array map

Oliver Atkinson edited this page May 10, 2026 · 1 revision

array_map

Maps each array element into a new value.

For each element, item is the current element.

Shape

{
  "{returns}": {
    "array_map": {
      "over": [],
      "copy": [],
      "into_self": false,
      "flattened": false
    }
  }
}
  • over is the source array.
  • copy describes fields to write for each output element.
  • into_self starts each output element from the original element instead of an empty object.
  • flattened flattens array outputs by one level.

Example

{
  "{returns}": {
    "array_map": {
      "over": [
        { "name": "Dorothy", "role": "traveler" },
        { "name": "Scarecrow", "role": "companion" }
      ],
      "copy": [
        {
          "value": { "{returns}": { "item": ["name"] } },
          "to": ["label"]
        }
      ]
    }
  }
}

The result is:

[
  { "label": "Dorothy" },
  { "label": "Scarecrow" }
]

Clone this wiki locally