FORCE_ARRAY

If the supplied argument is an array it returns it, otherwise wraps it in an array

Syntax 

FORCE_ARRAY(anything)

Examples 

Example 1

Input

{
  "my_action": {
    "message": "a string"
  }
}

Formula

FORCE_ARRAY(my_action.message)

Output

["a string"]
Example 2

Input

{
  "my_action": {
    "message": "Hello World"
  }
}

Formula

FORCE_ARRAY(my_action.missing_key)

Output

[]
Example 3

Input

{
  "my_action": {
    "message": [
      "1",
      "2",
      "3"
    ]
  }
}

Formula

FORCE_ARRAY(my_action.message)

Output

["1","2","3"]
Was this helpful?