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"}} renders fb, as documented.
  • {{fallback "" "fb"}} renders fb, as documented.
  • {{fallback (divide 1 0) "err"}} renders err, as documented.
Show Next test script
<!-- Marketing Cloud Next test script for the fallback helper. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[fb] got=[{{fallback missingVar "fb"}}]</p>
<p>c2 expect=[fb] got=[{{fallback "" "fb"}}]</p>
<p>c3 expect=[err] got=[{{fallback (divide 1 0) "err"}}]</p>

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