====== When(condition, expression) ====== Category: Logical function \\ =====Description===== This function returns the result of //expression// if //condition// is TRUE. Otherwise, it returns [[syntax:types|empty value]]. This function is effectively a shorthand version of '' if(condition, expression, empty()) '' \\ =====Arguments===== ^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, [[syntax:types|empty value]]. \\ =====Examples===== 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) \\ ===== See also ===== * [[syntax:functions:empty|Empty()]] * [[syntax:functions:if|If(condition, when_true, when_false)]]