Skip to main content

FlatMap

This formula is like the Map formula. However, it will also flatten the resulting list values into one. i.e: If the mapping returns three lists of numbers, this formula will return one list flat-appending (see FlatAppend) the three lists.

Returns

array<S>

JSON Format

{
"type": "flatMap",
"components": ...,
"mapper": ...,
"map_value_key": ...
}

RPG Script

This component can be written in RPG Script as:

flatMap(...)

Fields

FieldTypeRequiredDescription
map_value_keyStringOptional parameter that lets you provide a key to use in the mapper formula to access the array's current value in the iteration. e.g: if you are iterating classes, you might want to assign "$class" to the map_value_key, to make your system easier to read. This is also helpful when dealing with nested FlatMap formulas, as it will allow inner FlatMap formulas to access the values of outer filter formulas.