composition

composition takes a set of functions as arguments. This function sequentially executes those functions, first evaluating the rightmost expression and then providing the result to the function to its left, and so on.

Function category: Special

Syntax

composition(args...)

Arguments

Description

args

Set of functions, separated by commas.

Example

Let's say we want to design a function that joins two strings and then capitalizes the result.

{
"user_one": {
"first_name": "Claude",
"last_name": "Monet"
},
"user_two": {
"first_name": "Edouard",
"last_name": "Manet"
}
}

If we wanted to combine several values and the transform the result into all uppercase, use the following function.

# join two strings and capitalize results Using this function:
MAP(composition(UPPER, CONCATENATE),
[[user_one.first_name, user_one,last_name],
[user_two.first_name, user_two.last_name]
]
)
# Returns ["CLAUDEMONET","EDOUARDMANET"]