Index of Handlebars Functions

We organized the functions in this reference guide into categories based on the types of data that each function interacts with. For example, you can find information about Handlebars functions that manipulate dates and times in the Date & Time Functions category.

This table lists all the existing Handlebars functions on a single page in alphabetical order. The purpose of this index is to make it easier to explore and discover Handlebars functions that you might not have encountered otherwise.

Function Name Description Category
add Returns the sum of two numbers. Math
and Returns true if both operands are true. Comparison
assignCoupon Claims a coupon row from a marketing object. Data
base64Decode Converts Base64-encoded binary data to plain text. Utility
base64Encode Converts plain text to Base64-encoded binary data. Utility
buildUrl Creates a parameterized, click-tracked URL. Content
buildRowSetFromString Creates a rowset by splitting a string at a delimiter. Content
buildRowSetFromXML Loads XML data into a rowset by using an XPath expression. Content
char Returns a character when passed an ASCII character code. String
claimRow Returns and claims the first unclaimed row from a marketing object. Data
compare Compares two values using a specified operator. Comparison
concat Concatenates strings of text. String
dateAdd Adds or subtracts an amount of time to a date. Date & Time
dateDiff Calculates the time difference between two dates. Date & Time
datePart Extracts a specified part of a date or timestamp. Date & Time
divide Returns the result of dividing the first parameter by the second parameter. Math
each Loops through a list of items and renders a block of template code for each item. Objects
equals Compares two values for equality. Comparison
encode Calculates a cryptographic hash by using a specified algorithm. Encryption
encodeURI Converts a string to a format that is safe to use in a URL. HTTP
encodeURIComponent Encodes non-URL components of a string. HTTP
fallback Returns a fallback value if the first argument is null, empty, or if an exception occurs. Utility
filter Returns a list of items that match a condition. Objects
flatten Flattens a nested list into a single list. Objects
format Formats output based on a format string and optional type specification. Utility
formatCurrency Formats a number as a currency value. Utility
formatNumber Formats a number as a numeric type. Utility
get Returns the value of a property from an object. Objects
getContentBlock Retrieves and renders a content block within a template. Content
guid Generates a globally unique identifier (GUID). Content
hash Constructs an object for use in queries. Data
if Conditionally renders a block based on whether a value evaluates to true. Comparison
iif Evaluates an expression and returns one of two values based on whether the expression is true or false. Comparison
impressionRegion Defines an impression region in a message. Content
indexOf Returns the position at which a substring occurs within a string. String
isEmailAddress Tests whether an email address is structurally valid. Content
isEmpty Checks if a specified parameter evaluates to null or empty. Comparison
isNullDefault Returns a default value when a value is null. Utility
jsonPath Query and filter JSON objects. Objects
length Returns the length of a string or the number of elements in an array. Utility
lookup Access an object property or array element. Objects
lowercase Returns the provided string using only lowercase letters. String
map Extracts a specific field from each object in a list. Objects
md5 Converts a string to a 128-bit hexadecimal MD5 hash. Encryption
modulo Returns the remainder after dividing the first parameter by the second parameter. Math
multiply Returns the product of two numbers. Math
not Returns true if the operand is false. Comparison
now Returns the current system timestamp. Date & Time
or Returns true if at least one operand is true. Comparison
personalizationResult Retrieves personalized content or data based on subscriber information and campaign context. Personalization
properCase Returns specified string with the first letter of each word capitalized. String
query Retrieves multiple records from Sales Cloud or marketing object data sources. Data
queryFirst Retrieves the first record from Sales Cloud, marketing objects, or data graphs that matches the specified criteria. Data
raiseError Throws an exception with a specified error message and optional error code. Utility
random Returns a random number within a specified range. Math
regExMatch Searches a string for a pattern by using a regular expression. String
repeat Repeats a block of template code a specified number of times, providing loop context variables for each iteration. Utility
replace Replaces every occurrence of one substring with a different substring. String
set Performs local variable assignment within its block scope. Utility
sha1 Converts a string to a 160-bit hexadecimal SHA-1 hash. Encryption
sha256 Converts a string to a 256-bit hexadecimal SHA-2 hash. Encryption
sha512 Converts a string to a 512-bit hexadecimal SHA-2 hash. Encryption
slice Returns a portion of a list between two specified indices. Objects
sort Sorts a list of objects by a specified field. Utility
stringToHex Converts each character in a string to its hexadecimal equivalent. String
substring Returns a portion of a string, beginning at a specified character position. String
subtract Returns the result of subtracting the second parameter from the first parameter. Math
timeZoneConversion Converts a date from one time zone to another. Date & Time
trim Removes white space from the beginning and end of a string. String
unless Conditionally renders a block based on whether a value evaluates to false. Comparison
uppercase Returns the provided string using only uppercase letters. String
with Changes the context within a block to a specified object so that you can access properties without repeating the object name. Utility