#includeIf
Includes the property’s object when a path or condition is true, and sets it to null otherwise.
"#includeIf(condition) into 'name'": { ... }Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
condition |
path | boolean |
A path or boolean condition. |
Returns
Section titled “Returns”object — The evaluated object, or null.
Examples
Section titled “Examples”Include an object conditionally
Section titled “Include an object conditionally”{ "someValue": 7}{ "#includeIf(#valueOf($.someValue) > 5) into 'result'": { "message": "Greater than 5" }}{ "result": { "message": "Greater than 5" }}