COALESCE function

COALESCE is a miscellaneous function that lets you provide default values for fields.

Syntax

Read syntax diagramSkip visual syntax diagramCOALESCE(,source_value)

The COALESCE function evaluates its parameters in order and returns the first one that is not NULL. The result is NULL if, and only if, all the arguments are NULL. The parameters can be of any scalar type, but they need not all be of the same type.

Use the COALESCE function to provide a default value for a field, which might not exist in a message. For example, the expression:
COALESCE(Body.Salary, 0)
returns the value of the Salary field in the message if it exists, or 0 (zero) if that field does not exist.