Coalesce function in built-in functions

By Bruno Gonçalves on 26 Jan

Variable ?? DefaultValue

if the variable is empty / null the DefaultValue is assigned

I'm not sure I understand. A variable, by default, has the default value. Which is the default value for the variable's type if no explicit default is specified.

A default value would be assigned once when the variable is created.  It can still be set to null later on.  The coalesce function would at run-time instant decide whether to use a default value or not.

I still don't understand: when the variable is "created", i.e. when it is defined, it already gets the default value.

Kilian, I think what Bruno is trying to say is this:

Variable ?? AlternativeValue

If the variable is null, use the alternative value instead, i.e. Employee.FirstName ?? "N/A"

The thing is though, there are no NULL values in the Platform. So there's no way we can test for a NULL value, since they don't exist!