Skip to content

#if

Evaluates one of two expressions depending on a boolean condition.

#if(condition, whenTrue, whenFalse)
Category Control flowValid in Property value
Name Type Description
condition boolean The condition to test.
whenTrue any Evaluated and returned when the condition is true.
whenFalse any Evaluated and returned when the condition is false.

any

source.json
{
"someValue": 7
}
transformer.json
{
"result": "#if(#valueOf($.someValue) > 5, 'Greater than 5', 'Less than or equal to 5')"
}
output.json
{
"result": "Greater than 5"
}

Try it in the playground →

#includeIf · #match