IS_YAML

Checks if a text value is valid YAML. When strict is TRUE, the function will only return true if the input is a valid YAML document that contains key-value pairs.

Syntax 

IS_YAML(text, [parse_date_or_time: FALSE], [strict: FALSE])

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": "foo: bar"
4
}
5
}

Formula

IS_YAML(my_action.message)

Output

true

Example 2

Input

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

Formula

IS_YAML(my_action.message)

Output

false

Example 3

Input

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

Formula

IS_YAML(my_action, parse_date_or_time: TRUE)

Output

true

Example 4

Input

1
{
2
"my_action": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<note>\n <body>foo bar</body>\n</note>"
3
}

Formula

IS_YAML(my_action, strict: TRUE)

Output

false
Was this helpful?