# Led Node red dashboard doesn't work with string

**URL:** <https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810>\
**Category:** Dashboard\
**Created:** [17 January 2022 15:45 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810 "2022-01-17T15:45:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![josemspedro](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@josemspedro](https://discourse.nodered.org/u/josemspedro)\
**Post date:** [17 January 2022 15:45 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810/1 "2022-01-17T15:45:27Z")

</div>

Hello.  
I am using the nodes in the picture to read from the database a string and control the led according to the value of that string.

 ![nodes](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/a/8a1e0003a60aadb1a35a774ae68ddcb7df409a0b.png)  
In the node fuction I have : "msg.topic="SELECT connected FROM BootNotification WHERE CP\_id='CP\_1'. To take the string from the database.  
In msg.payload I can see the string that I get from database in an array. However, the led doesn´t change the color according the value of the string.  
Someone can help me??

---

<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:** [17 January 2022 15:47 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810/2 "2022-01-17T15:47:50Z")

</div>

you probably need to use a change node to copy the `connected` value into payload before the LED node (guessing as I dont use it)

show me the config page of the LED node and the value of `msg.payload` in the debug output.

---

<div class="post-metadata">

**Author:** ![josemspedro](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@josemspedro](https://discourse.nodered.org/u/josemspedro)\
**Post date:** [17 January 2022 15:51 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810/3 "2022-01-17T15:51:53Z")

</div>

Hello and thanks for your reply.  
How the led is set up:

 ![connected](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/b/ab7670387cfa59e8268c624976f2d42aa2ef1c12.png)  
An the debug of msg.payload:  
 ![paylaod](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a09969602508960bd952abddfc0d90bbca6511c0.png)

---

<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:** [17 January 2022 15:59 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810/4 "2022-01-17T15:59:52Z")

</div>

ok, according to the config page, the LED node expects `msg.payload` to be "connected" or "disconnected" BUT as you can see, the debug output of the database is an array with 1 element that is an object with a property of `connected` that holds the value.

So, use the "copy path" button (appears when you hover over item of interest) to grab the actual path of `connected` and use a change node to move/copy the value into `msg.payload`

I.E. database node \>\> change node \>\> LED node

change node\* Set `msg.payload` to the value of `msg.<copied path>`

---

<div class="post-metadata">

**Author:** ![josemspedro](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@josemspedro](https://discourse.nodered.org/u/josemspedro)\
**Post date:** [17 January 2022 16:12 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810/5 "2022-01-17T16:12:40Z")

</div>

Good...It works.  
Thank you

---

<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:** [31 January 2022 16:13 UTC](https://discourse.nodered.org/t/led-node-red-dashboard-doesnt-work-with-string/56810/6 "2022-01-31T16:13:17Z")

</div>

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