# How to access array element by index in mustache in template node

**URL:** <https://discourse.nodered.org/t/how-to-access-array-element-by-index-in-mustache-in-template-node/26588>\
**Category:** General\
**Created:** [13 May 2020 10:49 UTC](https://discourse.nodered.org/t/how-to-access-array-element-by-index-in-mustache-in-template-node/26588 "2020-05-13T10:49:21Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [13 May 2020 11:26 UTC](https://discourse.nodered.org/t/how-to-access-array-element-by-index-in-mustache-in-template-node/26588/4 "2020-05-13T11:26:14Z")

</div>

use `.0` instead of `[0]`

```auto
[{"id":"12a4c5dc.63ca2a","type":"template","z":"dadb596f.70e948","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"This works: {{{payload.text}}}, and this not: {{{payload.template.fields[0]}}} but this does... {{{payload.template.fields.0}}} !","output":"str","x":600,"y":100,"wires":[["cad92c2c.cb817"]]}]

```

```auto
This works: {{{payload.text}}}, and this too: {{{payload.template.fields.0}}}!

```

---

_[View the full topic](https://discourse.nodered.org/t/how-to-access-array-element-by-index-in-mustache-in-template-node/26588)._
