Skip to content

#includeIf

Includes the property’s object when a path or condition is true, and sets it to null otherwise.

"#includeIf(condition) into 'name'": { ... }
Category Control flowValid in Property name
Name Type Description
condition path | boolean A path or boolean condition.

object — The evaluated object, or null.

source.json
{
"someValue": 7
}
transformer.json
{
"#includeIf(#valueOf($.someValue) > 5) into 'result'": { "message": "Greater than 5" }
}
output.json
{
"result": { "message": "Greater than 5" }
}

Try it in the playground →

#if