YAML_PARSE

Takes text containing YAML and parses to an object

Syntax 

YAML_PARSE(text, [parse_date_or_time: FALSE], [version: 1])

Usage examples 

Example 1

Input

1
{
2
"my_action": "---\ntimeout: 10\nqueues:\n- one\n- two\n- three\nscheduler:\n max_workers: 10\n"
3
}

Formula

YAML_PARSE(my_action)

Output

1
{
2
"queues": [
3
"one",
4
"two",
5
"three"
6
],
7
"scheduler": {
8
"max_workers": 10
9
},
10
"timeout": 10
11
}

Example 2

Input

1
{
2
"my_action": "\nLinkedDate: 2007-04-01 12:00:00\n"
3
}

Formula

YAML_PARSE(my_action, parse_date_or_time: TRUE)

Output

1
{
2
"LinkedDate": "2007-04-01 12:00:00 UTC"
3
}

Example 3

Input

1
{
2
"my_action": "---\nNestedObject:\n LinkedDate: 2007-04-01 12:00:00\n List:\n - :foo\n - bar\n"
3
}

Formula

YAML_PARSE(my_action, version: 2)

Output

1
{
2
"NestedObject": {
3
"LinkedDate": "2007-04-01 12:00:00 UTC",
4
"List": [
5
"foo",
6
"bar"
7
]
8
}
9
}

Sample Actions 

Event Transform
My Action
Event Transform
YAML_PARSE

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?