# Pulling data value from an array

**URL:** <https://discourse.nodered.org/t/pulling-data-value-from-an-array/53590>\
**Category:** General\
**Created:** [11 November 2021 19:42 UTC](https://discourse.nodered.org/t/pulling-data-value-from-an-array/53590 "2021-11-11T19:42:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlongfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rlongfield/32/14264_2.png) [@rlongfield](https://discourse.nodered.org/u/rlongfield)\
**Post date:** [11 November 2021 19:42 UTC](https://discourse.nodered.org/t/pulling-data-value-from-an-array/53590/1 "2021-11-11T19:42:43Z")

</div>

I was hoping that I might be able to pull a value from an array in a template node.

However it seems that my attempt get the value from the array is ignored.

The template node has this code

`Turning on the {{entities[1].value}}{{slots.object}}`

Here is the array:

```auto
2 : msg : Object
object
intent: object
entities: array[3]
0: object
1: object
entity: "room"
value: "living room"
value_details: object
raw_value: "living room"
start: 12
end: 23
raw_start: 12
raw_end: 23
2: object

```

Do I need to use a function first to extract the value and assign it elsewhere in the messsage?

So right now Rhasspy is saying "Turning on the lamp", which isn't terrible but I'd really like to get the qualifier (living room) in there.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [11 November 2021 20:15 UTC](https://discourse.nodered.org/t/pulling-data-value-from-an-array/53590/2 "2021-11-11T20:15:25Z")

</div>

> [@rlongfield](#):
>
> entities[1].value

The template node does not use the [] notation for arrays  
try  
`entities.1.value`

---

<div class="post-metadata">

**Author:** ![rlongfield](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rlongfield/32/14264_2.png) [@rlongfield](https://discourse.nodered.org/u/rlongfield)\
**Post date:** [11 November 2021 20:49 UTC](https://discourse.nodered.org/t/pulling-data-value-from-an-array/53590/3 "2021-11-11T20:49:16Z")

</div>

Thank you, that did the trick

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 November 2021 20:49 UTC](https://discourse.nodered.org/t/pulling-data-value-from-an-array/53590/4 "2021-11-25T20:49:37Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
