SLICE_ARRAY

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

Syntax 

SLICE_ARRAY(array, start_index, [length])

Examples 

Example 1

Input

{
  "my_action": {
    "message": [
      "north",
      "south",
      "east",
      "west"
    ]
  }
}

Formula

SLICE_ARRAY(my_action.message, 2)

Output

[
  "east",
  "west"
]
Example 2

Input

{
  "my_action": {
    "message": [
      "north",
      "south",
      "east",
      "west"
    ]
  }
}

Formula

SLICE_ARRAY(my_action.message, 1, 2)

Output

[
  "south",
  "east"
]
Example 3

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

Input

{
  "my_action": {
    "message": [
      "north",
      "south",
      "east",
      "west"
    ]
  }
}

Formula

SLICE_ARRAY(my_action.message, 1, 50)

Output

[
  "south",
  "east",
  "west"
]
Was this helpful?