MAP
MAP applies a function to every element in a collection and returns an array.
Function category: Collection

Syntax

MAP(arg1, arg2)
Arguments
Description
arg1
Function to be applied to the collection.
arg2
A collection.

Examples

Let's say we're given a response with the following vehicle information:
1
{
2
"data": {
3
"fleet_prices": [
4
16000,
5
17450,
6
9200
7
],
8
"fleet_names": [
9
"bmw",
10
"audi",
11
"mercedes benz"
12
]
13
}
14
}
Copied!
If we want all of the values in fleet_names to be capitalized, we can use MAP with the UPPER function.
1
# Capitalize values in a collection
2
MAP(FN(x,UPPER(x)), data.fleet_names)
3
4
# Returns ["BMW, "AUDI", "MERCEDES BENZ"]
Copied!
Last modified 1yr ago
Export as PDF
Copy link