---
schema_version: "1"
id: 863b46eb75a6b25b9c6408e6b75e0a8bfcd7abc830f110ab35e81c40b4407a9a
title: "Handlebars Helper Function: jsonpath"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/objects/mcn-handlebars-reference-objects-jsonpath.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-objects-references/mcn-handlebars-reference-objects-jsonpath.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6869fac7cb96de71ab70fda9adb880eb379563c4ffb6da9cec1534f0a5de4788
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: jsonpath

Use JSONPath expressions to query and filter JSON objects. Use this helper to extract specific values or arrays from complex JSON objects.

## Availability

This helper is available in the Summer ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{jsonpath object expression}}
```

## Parameters

| Parameter    | Type                     | Description                                                                                        |
| ------------ | ------------------------ | -------------------------------------------------------------------------------------------------- |
| `object`     | Object, Array, or String | Required. The JSON object, array, or JSON string to query.                                         |
| `expression` | String                   | Required. The JSONPath expression to apply to the object. All JSONPath expressions begin with `$`. |

### JSONPath Syntax

The `expression` parameter can include these JSONPath patterns:

- `$.field` — Access a property in the top level of the object.
- `$.a.b` — Access a nested property by specifying its path.
- `$[x]` — Access an array element by its index. Arrays are zero-indexed, so the first item in the array is item `0`.
- `$[x:y]` — Select a range of array elements. The starting element of the range is zero-indexed and inclusive, and the ending element is exclusive, so [0:3] returns the first three objects in the array.
- `$[-1]` — Access the final element in an array.
- `$[*]` — Select all elements in an array.
- `$..field` — Find all values of the specified field, regardless of its level in the parent object. This pattern is known as recursive descent.
- `$[?(expr)]` — Filter the expression by specifying a field, operator, and value.

### Filter Operators

When you use the `$[?(expr)]` syntax to filter an expression, the filter can contain these operators:

- `==` — equality
- `!=` — inequality
- `<` — less than
- `>` — greater than
- `<=` — less than or equal to
- `>=` — greater than or equal to
- `&&` — logical AND
- `||` — logical OR
- `=~` — regular expression (regex) match

## Return Value

The data type of the return value depends on the JSONPath expression.

Definite paths, which are expressions that refer to a single value, return the value itself. The data type of the value can be a string, number, boolean, object, or array. If the specified value isn’t found, the function throws an exception.

Indefinite paths, which are expressions that include wildcards and filters, return an array of matching values. If no matches are found, the function returns an empty array `[]`.

## Usage Examples

To access a nested property from an object, use dot notation, as shown in these examples.

```handlebars
{{jsonpath subscriber "$.firstName"}}
{{jsonpath subscriber "$.address.city"}}
```

The functions return the properties from the specified object. If the specified properties don’t exist, the function throws an exception.

### Array Operations

You can use this function to access data in arrays, as shown in this example:

```handlebars
{{jsonpath items "$[0:3]"}}
```

The function returns an array that contains the first three objects from the `items` array.

### Wildcard Selection

This example selects all elements in the `items` array.

```handlebars
{{jsonpath products "$.items[*]"}}
```

### Recursive Descent

This example finds all occurrences of the `price` field, regardless of their level in the parent object.

```handlebars
{{jsonpath data "$..price"}}
```

### Filter Expression

This example filters the parent object to include only elements from the `items` array where the value of the `price` field is greater than 100.

```handlebars
{{jsonpath products "$.items[?(@.price > 100)]"}}
```

## See Also

- [fallback](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/utility/mcn-handlebars-reference-utility-fallback.md)
- [get](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/objects/mcn-handlebars-reference-objects-get.md)
- [length](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/utility/mcn-handlebars-reference-utility-length.md)
- [each](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/objects/mcn-handlebars-reference-objects-each.md)
