syntax:functions:when

Category: Logical function

This function returns the result of *expression* if *condition* is TRUE. Otherwise, it returns empty value.

This function is effectively a shorthand version of ` if(condition, expression, empty()) `

Argument | Type | Description |
---|---|---|

condition | Expression | This is an expression or "test" that evaluates to either TRUE or FALSE. |

expression | Expression | Any expression. |

**Return value type:** Text, Number, Boolean (the value type of the returned value from *expression*), or, empty value.

when(2 + 2 = 4, 'Makes sense') //Returns 'Makes sense'

when(1 + 1 = 4, 'Makes sense') //Returns empty

when([FieldA] = 10, 'FieldA is 10') //Returns 'FieldA is 10' (where [FieldA] is 10)

when([FieldA] = 10, 'FieldA is 10') //Returns empty (where [FieldA] is 20)

syntax/functions/when.txt · Last modified: 2021/08/28 21:17 by craigt