TRUNCATE

Shorten text down to the number of characters passed as a parameter.

Syntax 

TRUNCATE(text, length, [ellipsis])

Examples 

Example 1

Input

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

Formula

TRUNCATE(my_action.message, 8)

Output

"Hello..."
Example 2

An optional third argument controls the characters inserted if the text is truncated (instead of `...`):

Input

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

Formula

TRUNCATE(my_action.message, 9, " etc")

Output

"Hello etc"
Example 3

Setting the third argument to `""` prevents any text being inserted if the text is truncated:

Input

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

Formula

TRUNCATE(my_action.message, 5, "")

Output

"Hello"
Was this helpful?