Handlebars isNullDefault
Handlebars isNullDefault: returns the first value, or the second one when the first is null.
Next
Runtime verified
Test scripts included
Returns the first value, or the second one when the first is null.
Syntax
{{isNullDefault value defaultValue}}
Returns any.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value |
any | Yes | The value to use when it is not null. |
defaultValue |
any | Yes | The replacement to use when the first value is null. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{isNullDefault "Premium" "Basic"}}rendersPremium, as documented.{{isNullDefault missingVar "Basic"}}rendersBasic, as documented.
Show Next test script
Marketing Cloud Next
Works as documented
Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.
See also
- AMPscript
IsNullDefault— the AMPscript equivalent - Official reference