TRUNCATEWORDS

Shortens text down to the number of words passed as the argument.

If the specified number of words is less than the number of words in the text, ... is appended to the text.

Syntax 

TRUNCATEWORDS(text, length, [ellipsis])

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": "Hello and welcome to Tines"
4
}
5
}

Formula

TRUNCATEWORDS(my_action.message, 3)

Output

"Hello and welcome..."

Example 2

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

Input

1
{
2
"my_action": {
3
"message": "Hello and welcome to Tines"
4
}
5
}

Formula

TRUNCATEWORDS(my_action.message, 3, " etc")

Output

"Hello and welcome etc"

Example 3

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

Input

1
{
2
"my_action": {
3
"message": "Hello and welcome to Tines"
4
}
5
}

Formula

TRUNCATEWORDS(my_action.message, 3, "")

Output

"Hello and welcome"

Sample Actions 

Event Transform
My Action
Event Transform
TRUNCATE WORDS

Select an Action to inspect.

You can also click "Copy Actions" and paste them in your Tines Story to see how they work.

Was this helpful?