Skip to main content

$ifelse

The $ifelse operator evaluates a condition and returns one of two values based on the result.

Input

  • An array containing exactly three values: the condition to evaluate, the value to return if true, and the value to return if false

Output

  • The second value if the condition is truthy, the third value otherwise

Examples

Basic Conditional

Result: "A" if score is greater than 90, otherwise "B"

Conditional with Field Access

Result: The active_date field if status is “active”, otherwise the inactive_date field