Syntax
SWITCH(expression, value_to_compare, value_to_return, ..., default_value)
Usage examples
Example 1
Formula | SWITCH(1+1, 2, 'true!', 1, 'false!', 'error!') |
Output | "true!" |
Example 2
Input | 1 { 2 "day_of_week": [ 3 "sunday" 4 ] 5 } |
Formula | SWITCH(day_of_week, 'monday', 'working', 'saturday', 'weekend', 'error') |
Output | "error" |