# An inputted array, how do i get just the temperature \[0\] shown on debug?

**URL:** <https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439>\
**Category:** General\
**Created:** [16 February 2025 11:58 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439 "2025-02-16T11:58:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [16 February 2025 11:58 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/1 "2025-02-16T11:58:00Z")

</div>

Hi,

This flow does work and i can get the temperature [0], but in the debug node it shows ALL msg.payload messages, I just want the temperature [0] value to be in debug ?

I have tried variations of Switch node at the start of the flow with 'has key', but still i get all or nothing.  
I prefer using gui nodes if possible, easier for me to understand 😀  
Thanks

Sent from Arduino to Node-RED

> {  
> "Sensors": [  
> {  
> "id": "DS1820\_Sensor\_01",  
> "temperature": 24.25,  
> "humidity": 0,  
> "location": "PC room",  
> "information": "Humidity is dummy data"  
> },  
> {  
> "id": "DS1820\_Sensor\_02",  
> "temperature": 25,  
> "humidity": 0,  
> "location": "PC room"  
> }  
> ]  
> }

My flow  
`[{"id":"d2663d6de10ed7c6","type":"group","z":"37097d1320355ac2","name":"Get part of data from an array","style":{"label":true,"fill":"#ffffbf","fill-opacity":"0.24"},"nodes":["87e6621391303f27","f87a2d4bfac63f54","939a0737a85ab770"],"x":794,"y":869,"w":502,"h":82},{"id":"87e6621391303f27","type":"link in","z":"37097d1320355ac2","g":"d2663d6de10ed7c6","name":"> JSON Data","links":["b770b07d30a4f9b0"],"x":835,"y":910,"wires":[["f87a2d4bfac63f54"]]},{"id":"f87a2d4bfac63f54","type":"change","z":"37097d1320355ac2","g":"d2663d6de10ed7c6","name":"Set only temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Sensors[0].temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":910,"wires":[["939a0737a85ab770"]]},{"id":"939a0737a85ab770","type":"debug","z":"37097d1320355ac2","g":"d2663d6de10ed7c6","name":"debug 224","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":910,"wires":[]}]`

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 February 2025 12:20 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/2 "2025-02-16T12:20:57Z")

</div>

> [@questuk](#):
>
> I just want the temperature [0] value to be in debug

Why do you want that? The debug is just for checking that flows are working correctly.  
If you mean that you want that value in msg.payload then you can use a Change node to Move it there. To find the path of the element you want to move then there’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<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:** [16 February 2025 12:27 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/3 "2025-02-16T12:27:31Z")

</div>

Looking at your flow and data, if the data is in msg.psyload it should work fine. I suspect the data is not in msg.payload, or msg.payload is an JSON and not an Object. Cant we see the debug set to complete message object please, prior to the change node..

---

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [16 February 2025 12:27 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/4 "2025-02-16T12:27:53Z")

</div>

HI Colin,

I always add a debug on the output of all my flows, so i cam isolate them if either I have a problem or want to just see certain flow outputs, i have been doing this for years 😀  
And it is so helpful

---

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [16 February 2025 13:23 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/5 "2025-02-16T13:23:18Z")

</div>

Well i think i have solved it, for each temperature in the JSON object, you only need to match **one** as a ' **switch**'  
Then use everything as normal and you **only** get the temperatures data out of debug.

 ![11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/11445602d230458dcd047b848920e91dbb0f24fd.png)

&nbsp; &nbsp;

 ![10](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/2/a2282a01c5bcbe1a6ff878da4bde387af357d8b5.png)

&nbsp; &nbsp;

and

 ![12](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/b/4b8aa2e4a360b3db973cc50d16e3921f2f751bfe.png)

&nbsp; &nbsp;  
and the flow if anyone wants to observe it

```auto
type or paste code her[{"id":"482d6deefb3d7b78","type":"group","z":"37097d1320355ac2","name":"Get part of data from an array","style":{"label":true,"fill":"#ffffbf","fill-opacity":"0.24"},"nodes":["fd7eaf06c4062231","d0b543cec0bfa9a7","9c831ef4a4497779","8a50b86e71bfb814","f66b9d09052172a9","48f29e88037cb94b"],"x":514,"y":2519,"w":622,"h":142},{"id":"fd7eaf06c4062231","type":"link in","z":"37097d1320355ac2","g":"482d6deefb3d7b78","name":"> JSON Data","links":["b770b07d30a4f9b0"],"x":555,"y":2590,"wires":[["8a50b86e71bfb814"]]},{"id":"d0b543cec0bfa9a7","type":"change","z":"37097d1320355ac2","g":"482d6deefb3d7b78","name":"Set only temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Sensors[0].temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":2560,"wires":[["9c831ef4a4497779"]]},{"id":"9c831ef4a4497779","type":"debug","z":"37097d1320355ac2","g":"482d6deefb3d7b78","name":"debug 233","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1020,"y":2560,"wires":[]},{"id":"8a50b86e71bfb814","type":"switch","z":"37097d1320355ac2","g":"482d6deefb3d7b78","name":"","property":"payload.Sensors[0]","propertyType":"msg","rules":[{"t":"hask","v":"temperature","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":650,"y":2590,"wires":[["d0b543cec0bfa9a7","f66b9d09052172a9"]]},{"id":"f66b9d09052172a9","type":"change","z":"37097d1320355ac2","g":"482d6deefb3d7b78","name":"Set only temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Sensors[1].temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":2620,"wires":[["48f29e88037cb94b"]]},{"id":"48f29e88037cb94b","type":"debug","z":"37097d1320355ac2","g":"482d6deefb3d7b78","name":"debug 235","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1020,"y":2620,"wires":[]}]e

```

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [16 February 2025 13:56 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/6 "2025-02-16T13:56:56Z")

</div>

An alternative approach: change the debug node to only display the temperature:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/3/e3f9a11ce855b12a42fa225a65d2871ebbf5e94a.png)

---

<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:** [17 May 2025 14:14 UTC](https://discourse.nodered.org/t/an-inputted-array-how-do-i-get-just-the-temperature-0-shown-on-debug/95439/8 "2025-05-17T14:14:48Z")

</div>

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