1. Docs
  2. Formulas
  3. Functions

MAP

Creates an array by extracting the values for a given key or path from an array of objects. Path is a dot-separated string of keys. If a property name has spaces, wrap it in square brackets and double quotes.

Categories: Arrays

Syntax

MAP(array_of_objects, path)

Examples

Example 1

Input

1
{
2
"my_action": {
3
"animals": [
4
{
5
"color": "Brown",
6
"type": "Dog"
7
},
8
{
9
"color": "Beige",
10
"type": "Cat"
11
}
12
]
13
}
14
}

Formula

MAP(my_action.animals, "type")

Output

1
[
2
"Dog",
3
"Cat"
4
]

Example 2

Input

1
{
2
"my_action": [
3
{
4
"a": {
5
"b": {
6
"c": "d"
7
}
8
}
9
}
10
]
11
}

Formula

MAP(my_action, "a.b.c")

Output

"d"

Example 3

Input

1
{
2
"fetch_data": {
3
"users": [
4
{
5
"User ID": "ID1"
6
},
7
{
8
"User ID": "ID2"
9
}
10
]
11
}
12
}

Formula

MAP(fetch_data.users, '["User ID"]')

Output

1
[
2
"ID1",
3
"ID2"
4
]

Sample actions

Event Transform
My Action
Event Transform
MAP

Select an action to inspect

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Was this helpful?