It is possible to use expression language to access specific items in an array if a numeric keys are used. The array can contain strings, number or objects.

Access array at index 1
{% {array_with_strings}[1] %} => "test_2"

Access array at index 1 and display value of "item"
{% {array_with_objects}[1]["item"] %} => "test_2"

Object keys must be wrapped with double quotes.
Numeric array keys should not be wrapped with quotes.

Example JSON
{
"array_with_objects": [
{
"item": "test"
},
{
"item": "test_2"
}
],
"array_with_strings": [
"test",
"test_2"
]
}
Was this article helpful?
Cancel
Thank you!