Handlebar Helper Function: Hash

Constructs an object from key-value pairs. Use this helper as a subexpression to pass structured data as a named parameter to other functions, such as queryFirst.

This helper is used only as a subexpression within other functions. It can’t be used on its own.

This helper is available in the Summer ’26 release of Marketing Cloud Next (API version 67.0).

There are two ways to specify values for this helper. You can specify values by using the equals operator, as in this example:

You can also specify values by using positional pairs of keys and values:

The function returns a map (LinkedHashMap) that contains all of the specified key-value pairs. The function preserves the order of the key-value pairs.

This example creates a simple object that contains literal values.

The function returns a simple hashmap object: {name=Alice, age=30}.

You can specify variables as key values, as shown in this example:

The returned object includes the value of the firstName variable for the greeting key.

This example uses the hash helper to provide search parameters to the queryFirst helper.