Get value from mysql in debug

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

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.

[{"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.

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) 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

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"

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.

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

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

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