Runtime verified Test scripts included

Reads one value from a list by index or from a map by key.

Syntax

{{get collection indexOrKey}}

Returns any.

Parameters

Name Type Required Description
collection any Yes List or map to read from.
indexOrKey any Yes The list index or the map key to retrieve.

Example

Tested in Marketing Cloud Next emails on 2026-11-22 and 2026-11-25:

  • {{get (hash color="yellow") "color"}} renders yellow, as documented.
  • With a list of two rows built in AMPscript (%%[ SET @rows = BuildRowsetFromJSON('[{"name":"Bob","age":27},{"name":"Ann","age":21}]', '$[*]', 1) ]%%), {{get (get rows 1) "name"}} renders Ann.
Show Next test script
<!-- Marketing Cloud Next test script for the get 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=[yellow] got=[{{get (hash color="yellow") "color"}}]</p>
<p>c2 expect=[Ann] got=[%%[ SET @rows = BuildRowsetFromJSON('[{"name":"Bob","age":27},{"name":"Ann","age":21}]', '$[*]', 1) ]%%{{get (get rows 1) "name"}}]</p>

Marketing Cloud Next

Works as documented

Reading a key from an object and an index from a list rendered as documented. Tested 2026-11-25 by rendering in a Marketing Cloud Next email.

See also