CHUNK_ARRAY

Chunks an array into arrays with chunk_size elements. The last chunk may contain less than chunk_size elements.

Syntax 

CHUNK_ARRAY(array, chunk_size)

Examples 

Example 1

Input

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

Formula

CHUNK_ARRAY(my_action.message, 2)

Output

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