PUSH

Adds one or more items to the end of an array.

Syntax 

PUSH(array, item1, ...)

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"array": [
4
"red",
5
"green"
6
]
7
}
8
}

Formula

PUSH(my_action.array, "blue")

Output

1
[
2
"red",
3
"green",
4
"blue"
5
]

Example 2

Takes one or more items as arguments.

Formula

PUSH([1, 2, 3], 4, 5, 6)

Output

1
[
2
1,
3
2,
4
3,
5
4,
6
5,
7
6
8
]

Example 3

Will add any item to the array, even another array. If you want to join two arrays together see CONCAT.

Formula

PUSH([1, 2, 3], [4, 5, 6])

Output

1
[
2
1,
3
2,
4
3,
5
[
6
4,
7
5,
8
6
9
]
10
]
Was this helpful?