Syntax
SLICE_ARRAY(array, start_index, [length])
Usage 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
Transform
My Action
Transform
SLICE_ARRAY
Transform
SLICE_ARRAY
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.