Structure Functions
Mappings: Functions and Expressions · Updated June 9, 2025
Element
Description
Returns the element at the supplied position in the list (1-based or starting from 1).
Syntax
ELEMENT(list, index)ℹ️ This function is a complement of the Index Function.
Examples
-
ELEMENT(["foo","bar","baz"],3)returnsbaz
Flatmap
Description
- Maps each value in the given list to a new list by application of a LAMBDA function to each value. Returns a combined list of all returned values. This function is the equivalent of running Flatten and Map together.
- Flatmap is a Lambda Helper function that can be used in conjunction with a Lambda function.
Syntax
FLATMAP(lambda, list)Alternatively, the Lambda function could be written as an expression with the name as follows:
eachThis is useful when calling all instances of a repeated attribute in source data. Typically, the each will be referenced in a Lambda Helper Function that supplies more information regarding the variable.
Examples
-
FLATMAP([each, each + 1], [1, 2, 3])returns[1, 2, 2, 3, 3, 4]
Flatten
Description
- Flattens all the values from one or more lists into a single list.
Syntax
FLATTEN(list, [list, ...])Examples
-
FLATTEN([[1,2],[2,4],[3,5]])returns[1, 2, 2, 4, 3, 5]
Get
Description
- Retrieves the value of the field specified in a source object or array. The function returns NULL if the field is not found or the default if one is provided.
- The field parameter must be wrapped in double quotes (")
-
sourceis a valid object name, representing the source object - The default parameter can be a quoted constant, another field, or a nested function.
Syntax
GET("field", object, default)Examples
-
GET("id",source,null)returns the value of theidfield in the data source, or null ifidis not present. -
GET("sku",source.line_items,null)returns the value of theskufield in the source data arrayline_items, or null ifskuis not present.
-
-
This function will return an error if there is no line_itemsarray in the source data - Null-handling for the
line_itemsarray can be incorporated using anotherGETfunction in the second position of the mainGETfunction, with an empty object ({}) as the fallback value:-
The additional
GETfunction:GET("line_items",source,{}) -
The fully-nested
GETfunction:GET("sku",GET("line_items",source,{}),null)
-
-
Index
Description
- Returns the position (1-based or starting from
1) within a list of a given value.
Syntax
INDEX(list, value)ℹ️ This function is a complement of the Element function.
Examples
-
INDEX(["foo","bar","baz"],"baz")returns3
List
Description
- Creates a list with the elements specified.
- List is a Lambda Helper function that can be used in conjunction with a Lambda function. Additionally, List can be used to create name/value pairs, which are useful when mapping to
propertieslabels in the Reactor Semantic models.
Syntax
- To write a simple list function:
LIST([elem, ...]) - To write a list of name/value pairs:
LIST({"name":definition,"value":definition]}, [{"name":definition,"value":definition}, ...]) -
nameandvaluemust be wrapped in double quotes (") - The definition of a
namemust a string be wrapped in double quotes (") - The definition of a
valuecan be any combination of hard-coded values (wrapped in double quotes), functions, field references, metadata fields, or operators - Multiple name-value pairs can be input, with pairs wrapped in squiggly brackets (
{}) and commas separating the pairs
Examples
-
LIST(1,2,3)returns[1,2,3] -
LIST({"name":"age","value":23})returns[{'name': 'age', 'value': 23}] -
LIST({"name":"age","value":source.age})returns a name/value pair with “age” as the name and the value of the source fieldageas the value
Map
Description
- Maps each value in the given list to a new value by application of a Lambda function to each value.
- Map is a Lambda Helper function that can be used in conjunction with a Lambda function.
Syntax
MAP(lambda, list)-
Alternatively, the Lambda function could be written as an expression with the name
eachas follows:each - This is useful when calling all instances of a repeated attribute in source data. Typically, the
eachwill be referenced in a Lambda Helper Function that supplies more information regarding the variable.
Examples
-
MAP(each + 1, [1, 2, 3])returns[2, 3, 4] -
For the following example, a source object (
source) contains the following data:{"items":[ { "sku":"123", "quantity":1, "price":29.99, "title":"watch"}, {"sku":"456", "quantity":2, "price":4.99, "title":"strap"}, {"sku":"789", "quantity":1, "price":2.99, "title":"cleaning cloth"}]}
MAP(each.quantity,GET("items",source,{})
returns
[1, 2, 1]