1. Docs
  2. Formulas
  3. Functions

SLICE_ARRAY

Returns the remainder of the array (or length elements of the array, if specified), beginning at the start_index.

Categories: Arrays

Syntax

SLICE_ARRAY(array, start_index, [length])

Examples

Example 1

Input

1
{
2
"my_action": {
3
"message": [
4
"north",
5
"south",
6
"east",
7
"west"
8
]
9
}
10
}

Formula

SLICE_ARRAY(my_action.message, 2)

Output

1
[
2
"east",
3
"west"
4
]

Example 2

Input

1
{
2
"my_action": {
3
"message": [
4
"north",
5
"south",
6
"east",
7
"west"
8
]
9
}
10
}

Formula

SLICE_ARRAY(my_action.message, 1, 2)

Output

1
[
2
"south",
3
"east"
4
]

Example 3: If `length` extends past the end of the array, it returns only the remainder of the array:

Input

1
{
2
"my_action": {
3
"message": [
4
"north",
5
"south",
6
"east",
7
"west"
8
]
9
}
10
}

Formula

SLICE_ARRAY(my_action.message, 1, 50)

Output

1
[
2
"south",
3
"east",
4
"west"
5
]

Sample actions

Event Transform
My Action
Event Transform
SLICE_ARRAY
Event Transform
SLICE_ARRAY
Event Transform
SLICE_ARRAY

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?