Handlebars get
Handlebars get: reads one value from a list by index or from a map by key.
Next
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"}}rendersyellow, 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"}}rendersAnn.
Show Next test script
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
- AMPscript
Field— does a similar job in AMPscript, with a different call shape - AMPscript
Row— does a similar job in AMPscript, with a different call shape - Official reference