Let us know so we can improve!
The online Trailblazer Community is now read-only. [Read the FAQ] [Get Help]
Retrieves a value from a list or map by index or key.
This helper is available in the Winter ’26 release of Marketing Cloud Next.
1{{get collection indexOrKey}}| Parameter | Type | Description |
|---|---|---|
collection | List or Map | Required. The list or map to retrieve from. |
indexOrKey | Integer or String | Required. The index to retrieve from a list or the key to retrieve from a map. |
The function returns the value at the specified index or key. If the index or key isn’t found, or if the collection type is invalid, the function throws an exception.
These examples show how to use the get function to retrieve a value by index or key from a list or map.
This example shows how to use the get function to get the value at the specified index. Note that the first element is at index 0.
1myList = ["apple","banana","cherry"];
2
3{{get myList 1}}The function returns banana.
You can also use the get function to retrieve a value by key from a map.
1myMap = {"apple": "red", "banana": "yellow", "orange": "orange"};
2
3{{get myMap "banana"}}The function returns yellow.
The get function is also helpful for retrieving nested values from lists or maps.
1myList = [{"apple": "red"}, {"banana": "yellow"}, {"orange": "orange"}];
2
3{{get (get myList 1) "banana"}}The function returns yellow.