Insert data to Microsoft Azure

Hi everyone. I would like to ask about why the Microsoft Azure every time just get one to two data only? how to solve this problems? Because my flow is when the groov view detected "1" or "0" I need to store the data in database.




and I tried to change my flow to the following pic also cannot. They just send 2 data to Microsoft Azure SQL Database.(actually I want to send all the data)
image

TQVM.

Generally a node in node read has no idea how many wires / messages are being sent to it.

You will need to join all those messages together before you send the message to the database node.

Take a look at the join node.

1 Like

Hi @ukmoose. Sorry for a noob questions. My flow like this how to using join node?


I retrieve the 1 and 0 from the groov view then I wrote some function (specific the name)and store in database.
image

Previous I using MSSQL dont have problems.

TQVM.

Currently you are sending 13 different messages milliseconds apart, to Azure SQL.

It would be better to send one command that posts all 13 bits of data into the database. To do that you need to join all the separate bits of data back together.

So for example you make the ac_pwr line put the data in to msg.ac_pwr etc etc

Then use the join node to join all the messages back up together, and then create your one database insert query.

[{"id":"87c48bfa.9ab17","type":"inject","z":"9fb9c7f0.5e3fb","name":"","topic":"","payload":"a","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":77,"y":256,"wires":[["e01e19e1.98da08","83402a83.7ea158"]]},{"id":"e01e19e1.98da08","type":"function","z":"9fb9c7f0.5e3fb","name":"ac_pwr","func":"msg.topic = \"ac_pwr\"\nmsg.payload = \"1\"\nreturn msg;","outputs":1,"noerr":0,"x":268,"y":183,"wires":[["5ba00b36.557f94","27624865.517168"]]},{"id":"83402a83.7ea158","type":"function","z":"9fb9c7f0.5e3fb","name":"alert_lvl","func":"msg.topic =\"alert_lvl\"\nmsg.payload = \"0\"\nreturn msg;","outputs":1,"noerr":0,"x":266,"y":280,"wires":[["5ba00b36.557f94","6ef4b3b5.c92fac"]]},{"id":"5ba00b36.557f94","type":"join","z":"9fb9c7f0.5e3fb","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":441,"y":242,"wires":[["1544d023.04522"]]},{"id":"1544d023.04522","type":"debug","z":"9fb9c7f0.5e3fb","name":"JOIN","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":603,"y":234,"wires":[]},{"id":"27624865.517168","type":"debug","z":"9fb9c7f0.5e3fb","name":"ac_pwr","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":407,"y":108,"wires":[]},{"id":"6ef4b3b5.c92fac","type":"debug","z":"9fb9c7f0.5e3fb","name":"alert_lvl","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":443,"y":455,"wires":[]}]
1 Like