Handlebars Helper Reference
The complete Handlebars helper catalog for Marketing Cloud Next — searchable and filterable, with the Core API version each helper became available in and its AMPscript equivalent where one exists.
Handlebars is the templating language of Marketing Cloud Next. This page lists every helper the language catalog knows about, where it came from, which Core API version introduced it, and whether AMPscript can express the same thing.
These rows come from the same language catalog that powers the SFMC Language Service and the ESLint rules. Unlike the Engagement AMPscript reference, no helper here has been through a runtime sweep yet — each name links to the official Salesforce reference instead of to a page on this site.
Origin tells you where a helper comes from: a Marketing Cloud Next helper is specific to the platform, a Handlebars built-in is part of the Handlebars language itself, and a Marketing Cloud Next platform entry is exposed by the runtime rather than by the templating layer.
All helpers
Every helper links to the official Salesforce reference — none of them has been through a runtime sweep on this site yet. API version is the Marketing Cloud Next Core API version the helper became available in. A row with no AMPscript equivalent can only be expressed in Handlebars.
| Helper | Category | API version | Returns | AMPscript equivalent | Description |
|---|---|---|---|---|---|
add
{{add value1 value2}}
|
Math | 65 | number |
Add |
Returns the sum of two numbers, rounded to 2 decimal places. |
and
{{and value1 [value2] [...valueN]}}
|
Comparison | 65 | boolean |
— | Returns true only when all operands are truthy. |
char
{{char code [repeated]}}
|
String | 65 | string |
— | Returns the Unicode character for a character code, optionally repeated. |
compare
{{compare leftValue operator rightValue}}
|
Comparison | 65 | boolean |
— | Compares two values using a specified operator. |
concat
{{concat value1 [value2] [...valueN]}}
|
String | 65 | string |
Concat |
Combines multiple values into a single string. Null values are skipped. |
dateAdd
{{dateAdd date number interval}}
|
Date & Time | 67 | string |
DateAdd |
Adds or subtracts an amount of time to a date. |
dateDiff
{{dateDiff date1 date2 interval}}
|
Date & Time | 67 | integer |
DateDiff |
Calculates the time difference between two dates in a specified unit. |
divide
{{divide dividend divisor}}
|
Math | 65 | number |
Divide |
Returns the quotient of dividing the first value by the second. |
eachblock
{{#each collection}}…{{/each}}
|
Objects | 65 | string |
— | Iterates over arrays, lists, and objects, rendering a block for each element. |
equals
{{equals value1 value2 [compareAs]}}
|
Comparison | 65 | boolean |
— | Compares two values for equality, optionally by a comparison type. |
fallbackinline or block
{{fallback value fallbackValue}}
|
Utility | 65 | any |
— | Returns a fallback value when the first argument is null, empty, or throws an exception. |
filter
{{filter list fieldName comparisonOperator targetValue filterAs}}
|
Objects | 65 | array |
— | Returns a list of items that match a field/operator/value condition. |
flatten
{{flatten nestedList}}
|
Objects | 65 | array |
— | Flattens a nested list of lists into a single list. |
format
{{format subject formatString [type] [culture]}}
|
Utility | 65 | string |
Format |
Formats output based on a format string and optional type specification. |
formatCurrency
{{formatCurrency number [cultureCode]}}
|
Utility | 65 | string |
FormatCurrency |
Formats a number as a currency value for a locale. |
formatNumber
{{formatNumber number formatType [cultureCode]}}
|
Utility | 65 | string |
FormatNumber |
Formats a number as a specific numeric type, such as decimal or percentage. |
get
{{get collection indexOrKey}}
|
Objects | 65 | any |
— | Retrieves a value from a list or map by index or key. |
getContentBlock
{{getContentBlock key}}
|
Content | 67 | string |
— | Retrieves and renders a content block within a template. |
hashsubexpression only
(hash ...pairs)
|
Utility | 67 | object |
— | Constructs an object from key-value pairs. Used only as a subexpression within other helpers. |
ifblock
{{#if condition}}…{{/if}}
|
Comparison | 65 | string |
— | Conditionally renders a block based on whether a value evaluates to true. |
iif
{{iif expression leftResult rightResult}}
|
Comparison | 65 | any |
IIf |
Returns one of two values based on whether an expression is true or false. |
indexOf
{{indexOf subject search}}
|
String | 65 | integer |
IndexOf |
Returns the 1-based position of a substring within a string (case-insensitive). |
isEmpty
{{isEmpty input}}
|
Comparison | 65 | boolean |
Empty |
Returns true when a value is null, undefined, or an empty string. |
jsonPath
{{jsonPath object expression}}
|
Objects | 67 | any |
— | Queries and filters JSON objects using a JSONPath expression. |
length
{{length subject}}
|
Utility | 65 | integer |
Length |
Returns the length of a string or the number of elements in an array. |
lookup
{{lookup object key}}
|
Objects | 67 | any |
— | Dynamically accesses an object property or array element by a variable key. |
lowercase
{{lowercase subject [culture]}}
|
String | 65 | string |
Lowercase |
Converts all letters in a string to lowercase. |
map
{{map list fieldName}}
|
Objects | 65 | array |
— | Extracts a specific field from each object in a list. |
modulo
{{modulo value1 value2}}
|
Math | 65 | number |
Mod |
Returns the remainder after dividing the first value by the second. |
multiply
{{multiply value1 value2}}
|
Math | 65 | number |
Multiply |
Returns the product of two numbers, rounded to 2 decimal places. |
not
{{not value}}
|
Comparison | 65 | boolean |
— | Returns true when the operand evaluates to false. |
now
{{now}}
|
Date & Time | 67 | string |
Now |
Returns the current server date and time in UTC. Takes no parameters. |
or
{{or value1 [value2] [...valueN]}}
|
Comparison | 65 | boolean |
— | Returns true when at least one operand is truthy. |
personalizationResult
{{personalizationResult key}}
|
Personalization | 65 | any |
— | Retrieves a personalized value by key from the subscriber context. |
properCase
{{properCase subject [culture]}}
|
String | 65 | string |
ProperCase |
Capitalizes the first letter of each word and lowercases the rest. |
query
{{query object type [...options]}}
|
Utility | 67 | array |
— | Retrieves multiple records from Sales Cloud or marketing object data sources. |
queryFirst
{{queryFirst object type [...options]}}
|
Utility | 67 | object |
— | Retrieves the first record from Sales Cloud, marketing objects, or data graphs matching criteria. |
raiseError
{{raiseError errorMessage [errorCode]}}
|
Utility | 67 | void |
RaiseError |
Throws an exception with a message and optional error code, halting rendering. |
random
{{random first second}}
|
Math | 65 | integer |
Random |
Returns a random integer between two values (inclusive). |
repeatblock
{{#repeat count}}…{{/repeat}}
|
Utility | 65 | string |
— | Repeats a block a specified number of times, exposing index, first, and last loop variables. |
replace
{{replace subject search replacement [culture]}}
|
String | 65 | string |
Replace |
Replaces every occurrence of a substring with another (case-sensitive). |
setblock
{{#set ...assignments}}…{{/set}}
|
Utility | 65 | string |
— | Performs local variable assignment within the block scope. Variables do not persist outside the block. |
slice
{{slice list startIndex [endIndex]}}
|
Objects | 65 | array |
— | Returns a portion of a list between two indices (end index exclusive). |
sort
{{sort list fieldName sortOrder sortAs}}
|
Utility | 65 | array |
— | Sorts a list of objects by a field, order, and type. |
substring
{{substring subject start [length]}}
|
String | 65 | string |
Substring |
Extracts a portion of a string starting from a 1-based position. |
subtract
{{subtract value1 value2}}
|
Math | 65 | number |
Subtract |
Returns the difference of subtracting the second value from the first. |
timeZoneConversion
{{timeZoneConversion date sourceTZ targetTZ}}
|
Date & Time | 67 | string |
— | Converts a date from one time zone to another. |
trim
{{trim subject}}
|
String | 65 | string |
Trim |
Removes leading and trailing whitespace from a string. |
unlessblock
{{#unless condition}}…{{/unless}}
|
Comparison | 65 | string |
— | Conditionally renders a block based on whether a value evaluates to false. |
uppercase
{{uppercase subject [culture]}}
|
String | 65 | string |
Uppercase |
Converts all letters in a string to uppercase. |
withblock
{{#with object}}…{{/with}}
|
Utility | 65 | string |
— | Changes the block context to a specified object so properties can be accessed directly. |
Related
- AMPscript and Handlebars — how the two languages sit side by side in a Next template
- AMPscript function reference (Next) — the AMPscript subset Next supports
- Differs from official docs (Next) — where runtime behaviour contradicts the official reference