# Array to object

**URL:** https://discourse.nodered.org/t/array-to-object/14567
**Category:** General
**Created:** [20 August 2019 21:03 UTC](https://discourse.nodered.org/t/array-to-object/14567 "2019-08-20T21:03:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MarcW84](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@MarcW84](https://discourse.nodered.org/u/MarcW84)
#### Post date: [20 August 2019 21:03 UTC](https://discourse.nodered.org/t/array-to-object/14567/1 "2019-08-20T21:03:59Z")

</div>

Hi guys,  
I am very new to Node-Red and coding in general and trying to work with some values I receive from a node as an array as you see here:

L-Hue3 Flur EG : msg.payload : array[2]  
array[2]  
0: "100"  
1: "2700"

I would like to transform line 0: "100" to brightness: "100" and 1: "2700" to color\_temp: "2700"

So far I only know how to get values out of objects using their name, but not out of an array using their position.

Would you mind helping a beginner doing his first steps?

Thanks a lot.

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [20 August 2019 21:15 UTC](https://discourse.nodered.org/t/array-to-object/14567/2 "2019-08-20T21:15:22Z")

</div>

The page in the docs about working with messages shows how you can use the debug to get the path to any item in objects and arrays.

---

<div class="post-metadata">

### Author: ![MarcW84](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@MarcW84](https://discourse.nodered.org/u/MarcW84)
#### Post date: [20 August 2019 21:30 UTC](https://discourse.nodered.org/t/array-to-object/14567/3 "2019-08-20T21:30:22Z")

</div>

You are my hero. Its that simple if you know were to look it up. Wasted hours to get there.  
Thank you mate.
