Handlebars fallback
Handlebars fallback: returns a fallback value when the first argument is null, empty, or throws an exception.
Next
Runtime verified
Test scripts included
Returns a fallback value when the first argument is null, empty, or throws an exception.
Syntax
{{fallback value fallbackValue}}
{{#fallback value fallbackValue}}
…
{{/fallback}}
Returns any.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value |
any | Yes | The value to try first. |
fallbackValue |
primitive | Yes | Static value returned when the first value is null or fails. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{fallback missingVar "fb"}}rendersfb, as documented.{{fallback "" "fb"}}rendersfb, as documented.{{fallback (divide 1 0) "err"}}renderserr, 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.