Handlebars map
Handlebars map: returns a list with the value of one field from each object in a list.
Next
Runtime verified
Test scripts included
Returns a list with the value of one field from each object in a list.
Syntax
{{map list fieldName}}
Returns array.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
list |
array | Yes | List of objects to read. |
fieldName |
string | Yes | Field to read from each object. |
Example
Tested in Marketing Cloud Next emails on 2026-11-22 and 2026-11-25:
{{#if false}}{{map myList "name"}}{{/if}}is accepted when the email is saved. The branch never runs, so the helper itself is not rendered.- With a list of two rows built in AMPscript (
%%[ SET @rows = BuildRowsetFromJSON('[{"name":"Bob","age":27},{"name":"Ann","age":21}]', '$[*]', 1) ]%%),{{#each (map rows "age")}}[{{this}}]{{/each}}renders[27][21]. {{map rows "name"}}on the same rows renders[Bob, Ann].
Show Next test script
Marketing Cloud Next
Works as documented
Rendered as documented on a list of rows built in AMPscript. Tested 2026-11-25 by rendering in a Marketing Cloud Next email.