---
schema_version: "1"
id: 8d248100d1c621f2b7aa8cb973ad36a23a28f6c50aadc581855ca207f36ff1c3
title: "Handlebars Helper Function: hash"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/data/mcn-handlebars-reference-data-hash.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-data-references/mcn-handlebars-reference-data-hash.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 895c84efe45df6ee27a7ee5d163556f4ff79fda8ad67817f552ab2e22625a17c
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars 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](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/data/mcn-handlebars-reference-data-queryfirst.md).

**note:** Use this helper only as a subexpression within other functions.

## Availability

This helper is available in the Summer ’26 release of Marketing Cloud Next.

## Syntax

There are two ways to specify values for this helper. You can specify values by using the equals operator, as in this example:

```handlebars
(hash key1=value1 key2=value2 ...)
```

You can also specify values by using positional pairs of keys and values:

```handlebars
(hash key1 value1 key2 value2 ...)
```

## Return Value

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.

## Usage Examples

This example creates a simple object that contains literal values.

```handlebars
{{hash name="Alice" age=30}}
```

The function returns a simple hashmap object: `{name=Alice, age=30}`.

### Using Variable References

You can specify variables as key values, as shown in this example:

```handlebars
{{hash greeting=firstName status="active"}}
```

The returned object includes the value of the `firstName` variable for the `greeting` key.

### Using with QueryFirst

This example uses the `hash` helper to provide search parameters to the `queryFirst` helper.

```handlebars
{{queryfirst type="CRM" object="Account"
  where="Name LIKE :search"
  params=(hash search="Acme%")}}
```

## See Also

- [query](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-data-references/mcn-handlebars-reference-data-query.md)
- [queryFirst](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-data-references/mcn-handlebars-reference-data-queryfirst.md)
