WHERE

Takes an array of objects, a path and a value. The path can be a single key or a dot-separated series of keys. Returns a new array containing only the objects where the value at the key/path matches the provided value.

Syntax 

WHERE(array, path, value)

Usage examples 

Example 1

Input

1
{
2
"staff": [
3
{
4
"name": "Alice",
5
"department": "engineering"
6
},
7
{
8
"name": "Bob",
9
"department": "sales"
10
},
11
{
12
"name": "Charlie",
13
"department": "engineering"
14
}
15
]
16
}

Formula

WHERE(staff, "department", "engineering")

Output

1
[
2
{
3
"name": "Alice",
4
"department": "engineering"
5
},
6
{
7
"name": "Charlie",
8
"department": "engineering"
9
}
10
]

Example 2

Input

1
{
2
"staff": [
3
{
4
"name": "Alice",
5
"department": {
6
"name": "engineering",
7
"role": "manager"
8
}
9
},
10
{
11
"name": "Bob",
12
"department": {
13
"name": "sales",
14
"role": "assistant"
15
}
16
},
17
{
18
"name": "Charlie",
19
"department": {
20
"name": "sales",
21
"role": "manager"
22
}
23
}
24
]
25
}

Formula

WHERE(staff, "department.role", "manager")

Output

1
[
2
{
3
"name": "Alice",
4
"department": {
5
"name": "engineering",
6
"role": "manager"
7
}
8
},
9
{
10
"name": "Charlie",
11
"department": {
12
"name": "sales",
13
"role": "manager"
14
}
15
}
16
]

Sample Actions 

Transform
My Action 2
Transform
WHERE
Transform
My Action 1

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?