User Tools

Site Tools


IfEmpty(expression1, expression2)

Category: Logical function


This function returns the result of expression2 if the result of expression1 is empty. Otherwise, it returns the result of expression1.

Use cases

This function can be used as an error handler in cases where an expression could potentially return an empty value. In such a case, the return value from expression2 acts as a "safety net" so the process can continue.


expression1ExpressionAny expression that could potentially have an 'empty' result being tested for.
expression2ExpressionAny expression.

Return value type: Any (The data type of the return value of expression1 or expression2.)


If both expression1 and expression2 evaluate to an empty value, an empty value is returned.


ifempty( [FieldA], 'Other' ) //Returns 'Other' (assuming [FieldA] is empty)
ifempty( [FieldA], 'Other' ) //Returns 'Another' (assuming [FieldA] = 'Another')

See also

syntax/functions/ifempty.txt · Last modified: 2021/08/16 03:17 by craigt