SLICE

Returns 1 or length characters from a piece of text, beginning at the start_index.

Syntax 

SLICE(text, start_index, [length])

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": "hello world"
4
}
5
}

Formula

SLICE(my_action.message, 6)

Output

"w"

Example 2

Input

1
{
2
"my_action": {
3
"message": "hello world"
4
}
5
}

Formula

SLICE(my_action.message, 6, 5)

Output

"world"

Example 3

If length extends past the end of the piece of text, it returns only the remainder of the text:

Input

1
{
2
"my_action": {
3
"message": "hello world"
4
}
5
}

Formula

SLICE(my_action.message, 6, 50)

Output

"world"

Example 4

start_index can be specified as a negative number to count back from the end of the piece of text:

Input

1
{
2
"my_action": {
3
"message": "hello world"
4
}
5
}

Formula

SLICE(my_action.message, -5, 5)

Output

"world"

Sample Actions 

Event transform
My Action
Event transform
SLICE
Event transform
SLICE
Event transform
SLICE
Event transform
SLICE

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?