Runtime verified Test scripts included

Queries and filters JSON objects using a JSONPath expression.

Syntax

{{jsonpath object expression}}

Returns any.

Parameters

Name Type Required Description
object any Yes JSON object or array, or a JSON string, to search.
expression string Yes The JSONPath expression to apply, beginning with $.

Example

Tested in a Marketing Cloud Next email on 2026-11-25, alone in the email:

  • {{jsonpath (buildRowSetFromString "a|b|c" "|") "$[1]"}} renders b, as documented (zero-based index).
  • Helper names are case-sensitive. {{jsonPath …}} (camelCase) is rejected when the email is saved as an unsupported helper; only the documented spelling jsonpath works.
Show Next test script
<!-- Marketing Cloud Next test script for the jsonpath helper. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[b] got=[{{jsonpath (buildRowSetFromString "a|b|c" "|") "$[1]"}}]</p>
<p>c2 expect=[2] got=[{{length (jsonpath '[[1,2],[3,4,5]]' "$")}}]</p>

Show calls that fail in Next (one email each)
<!-- Run each call below in its own Next email: one of them in a combined email
     would stop the whole preview or block the save. -->

<!-- email 1: expect that the save is rejected (HTTP 400) -->
{{jsonPath '{"a":{"b":"x"}}' "$.a.b"}}

Marketing Cloud Next

Works as documented

Write the name in lowercase, as the docs do: jsonpath. The camelCase spelling jsonPath is rejected when the email is saved. Tested 2026-11-25 by rendering in a Marketing Cloud Next email.

See also