Handlebars Helper Function: isNullDefault

Returns a default value when the first value is null.

Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

Syntax

{{isNullDefault nonNullValue nullValue}}

Parameters

Parameter Type Description
nonNullValue Any Required. The value to return when it isn't null.
nullValue Any Required. The default value to return when nonNullValue is null.

Return Value

The function returns nonNullValue unless the value is null. When nonNullValue is null, it returns nullValue.

Usage Example

This example returns a customer's membership tier, returning Basic if the value of tier is null.

{{isNullDefault tier "Basic"}}

If the tier variable resolves to any value, such as "Premium", the function returns that value.

Premium

If tier is null, the function returns the fallback value.

Basic