Combine Data / Array

Hi, everyone. I have a problems about the join node.

Example : When I interval the timestamp, all the node will run. Their will display 26 data.


But now the problems is sometime the join node get the duplicated data. (Example : 2 main_fail).

If I dont want using join node, How to write a function combine all the array or data?


The following picture is main_fail function(active) and main_fail(off).

msg.main_fail[0] is I get the data from database. Then the IntData check is 1 or 0 if it is one the run the msg.payload else return null. So my join node got 26 data or array.

If got any suggestion I will try.


What are the database nodes you are using? Have you tried optimising those, to reduce the number different searches?

1 Like

If you are using the join node to manually join the messages, each message needs to have defined as it explainse in the node's info tab. If you assign each msg to be joined a unique, then the join node will wait for all 26 parts to show up.

1 Like

I'm using MSSQL.
This is the main_fail active.

This is the main_fail off.

I need to check the database weather is 1 or 0.
Maybe I try to optimize it.

How to define every Sorry I not very expert using node-RED.

After using Join node I put all the payload inside the function node.


This is my problems. Sorry for broken english.

Step 1: In the groov view I key in all is β€œ0” mean they just send the Off node to the website.
Step 2 : I key in main_fail and upsensor_fail become β€œ1”, they just send the main_fail (active), upsensor_fail (active) other send the off node.
Step 3 : I key in the upsensor_fail become β€œ0”, they just send the main_fail (active) other send the off node.
until step 3 don’t have problems when I continue with step 4…
Step 4 : I key in the main_fail become β€œ0”, sometime I can get the main_fail β€œ0” sometime I get multiple s_estop .