# Get value from mysql in debug

**URL:** https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772
**Category:** General
**Tags:** database
**Created:** [17 November 2022 13:31 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772 "2022-11-17T13:31:20Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Ynfante](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@Ynfante](https://discourse.nodered.org/u/Ynfante)
#### Post date: [17 November 2022 13:31 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/1 "2022-11-17T13:31:20Z")

</div>

hello I am trying to take the value of "SANTIAGO,ALEX,LUIS D." but I have tried and there is no way I have tried to take it using my change node using the msg.payload[0].return ('{ "ACTION":"RET.LIST.CHF-S","ID":1}' ): but it doesn't work anyway, could someone please tell me what I'm doing wrong

 ![Captura desde 2022-11-17 09-22-57](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/1/b1e0fc1ec492cd6418e9ed59d4c213cb29279c12.png)

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [17 November 2022 14:31 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/2 "2022-11-17T14:31:22Z")

</div>

I suggest you add some 'debug' nodes so you can see the query going into the MySQL node and what is coming out from that node. It would help if you could post your flow as people could see and check your query.

---

<div class="post-metadata">

### Author: ![Ynfante](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@Ynfante](https://discourse.nodered.org/u/Ynfante)
#### Post date: [17 November 2022 15:01 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/3 "2022-11-17T15:01:32Z")

</div>

```auto
[{"id":"32e6004c2eff1458","type":"tab","label":"Flow 6","disabled":false,"info":"","env":[]},{"id":"c63dc9a28e700266","type":"debug","z":"32e6004c2eff1458","name":"debug 16","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":760,"wires":[]},{"id":"8405958fc6eb9b7e","type":"mysql","z":"32e6004c2eff1458","mydb":"6923c886530c8eb4","name":"","x":340,"y":760,"wires":[["436915da48bbd125"]]},{"id":"436915da48bbd125","type":"json","z":"32e6004c2eff1458","name":"","property":"payload","action":"obj","pretty":true,"x":470,"y":760,"wires":[["2820021c97ad2f52"]]},{"id":"991f2f182b1b8c25","type":"sqlstring-format","z":"32e6004c2eff1458","name":"","query":"SELECT retornar ('{ \"ACTION\":\"RET.LISTA.CHF-S\",\"ID\":1}')","vars":"payload","outField":"topic","x":210,"y":760,"wires":[["8405958fc6eb9b7e"]]},{"id":"a513faae3e07dcc7","type":"inject","z":"32e6004c2eff1458","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"payload","payloadType":"msg","x":90,"y":760,"wires":[["991f2f182b1b8c25"]]},{"id":"2820021c97ad2f52","type":"change","z":"32e6004c2eff1458","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload[0]","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":760,"wires":[["c63dc9a28e700266"]]},{"id":"6923c886530c8eb4","type":"MySQLdatabase","name":"bdmodel","host":"localhost","port":"3306","db":"concre_model","tz":"","charset":"UTF8","credentials":{}}]

```

This is the flow I'm working on. You can check it and tell me how I could get those values. Thanks in advance.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [17 November 2022 17:49 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/4 "2022-11-17T17:49:56Z")

</div>

As Dave said, add a debug node (set to display the complete msg object) to the output of your 'SQL' node and to the output of the 'bdmodel' node.

Then show us the results of those two debugs.

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 to 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: ![Ynfante](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@Ynfante](https://discourse.nodered.org/u/Ynfante)
#### Post date: [17 November 2022 19:08 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/5 "2022-11-17T19:08:59Z")

</div>

Here is a sample photo so that you can see what I am sending and if you can understand, now I have configured the three debug nodes to grant the "complete msg object"

 ![Captura desde 2022-11-17 15-03-29](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/3/731669a62c3569be88b2bfa7cfada546000035e4.png)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [17 November 2022 19:39 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/6 "2022-11-17T19:39:07Z")

</div>

Please follow the direction I gave above and copy the object from 'debug 21' and paste it into a reply.

Also, what version of SQl are you using and where did you come up withthat select statement? I've never seen an sql statement formatted that way.

---

<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 November 2022 20:35 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/7 "2022-11-17T20:35:48Z")

</div>

Do you understand SQL? Look at the output of debug 22 - your SQL query is not asking for any fields from any table.

---

<div class="post-metadata">

### Author: ![Ynfante](https://avatars.discourse-cdn.com/v4/letter/y/a6a055/32.png) [@Ynfante](https://discourse.nodered.org/u/Ynfante)
#### Post date: [21 November 2022 19:33 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/8 "2022-11-21T19:33:41Z")

</div>

ok, the error was that the value of the table did not bring me the correct values ​​so the error was not in node-red it was in sql sorry

---

<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: [5 December 2022 19:34 UTC](https://discourse.nodered.org/t/get-value-from-mysql-in-debug/70772/9 "2022-12-05T19:34:00Z")

</div>

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