Array to object

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.

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.

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

1 Like