TO_SNAKE_CASE

Turn input text into snake case. When from_camel_case is true, the function will convert camel case to snake case.

Syntax 

TO_SNAKE_CASE(text, [from_camel_case: false])

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": "Hello World!"
4
}
5
}

Formula

TO_SNAKE_CASE(my_action.message)

Output

"hello_world"

Example 2

Input

1
{
2
"my_action": {
3
"message": "Testing-1 2 3"
4
}
5
}

Formula

TO_SNAKE_CASE(my_action.message)

Output

"testing_1_2_3"

Example 3

Input

1
{
2
"my_action": {
3
"message": "fooBar"
4
}
5
}

Formula

TO_SNAKE_CASE(my_action.message)

Output

"foobar"

Example 4

Input

1
{
2
"my_action": {
3
"message": "fooBar"
4
}
5
}

Formula

TO_SNAKE_CASE(my_action.message, from_camel_case: true)

Output

"foo_bar"

Sample Actions 

Transform
My Action
Transform
TO_SNAKE_CASE
Transform
My Action

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?