#if
Evaluates one of two expressions depending on a boolean condition.
#if(condition, whenTrue, whenFalse)Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”any
Examples
Section titled “Examples”Choose a message
Section titled “Choose a message”{ "someValue": 7}{ "result": "#if(#valueOf($.someValue) > 5, 'Greater than 5', 'Less than or equal to 5')"}{ "result": "Greater than 5"}