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
base64DecodeConverts Base64-encoded binary data to plain text.
base64EncodeConverts plain text to Base64-encoded binary data.
domainReturns the domain portion of an email address.
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.
guidGenerates a globally unique identifier.
isEmailAddressTests whether an email address is structurally valid.
isNullDefaultReturns a default value when a value is null.
lengthReturns the length of a string or the number of elements in an array.
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.