Handlebars Utility Functions

Use the Handlebars utility functions to perform several different types of tasks. The utility functions evaluate conditions, format numbers, output text, and more.

This section contains information about these Handlebars functions.

Function NameDescription
FallbackReturns a fallback value if the first argument is null, empty, or if an exception occurs.
FormatFormats output based on a format string and optional type specification.
FormatCurrencyFormats a number as a currency value.
FormatNumberFormats a number as a numeric type.
HashConstructs an object from key-value pairs.
LengthReturns the length of a string or the number of elements in an array.
QueryRetrieves multiple records from Sales Cloud or marketing object data sources.
QueryFirstRetrieves the first record from Sales Cloud, marketing objects, or data graphs that matches the specified criteria.
RaiseErrorThrows an exception with a specified error message and optional error code.
RepeatRepeats a block of template code a specified number of times, providing loop context variables for each iteration.
SetPerforms local variable assignment within its block scope.
SortSorts a list of objects by a specified field.
WithChanges the context within a block to a specified object so that you can access properties without repeating the object name.