$cond
Last updated
Last updated
$cond
operator lets you build conditions directly in CQL and returns you the item based on the condition passed in the object. You can use this in any .
<condition>
It can also be a Magical Autocomplete.
true
<true_val>
The value to return if the <condition>
resolves to true
.
It can also be a Magical Autocomplete.
true
<false_val>
The value to return if the <condition>
resolves to false
.
It can also be a Magical Autocomplete.
true
<object>
- Returns either the <true_val>
or <false_val>
based on the condition. The object type can be anything based on the values provided.
Let's say we have declared a variable country
in our API flow, which has an array value of US
currently.
The above expression returns 20 as the condition becomes false.
The <condition>
can be any valid as long as it resolves to a boolean object.