How to use join node with reduce sequence mode

Hello,

As part of learning node red I was trying to use the join node . I was able to use and understand the join node with automatic and manual mode option. But I am not able to understand how to use the reduce sequence mode and the use case where I could apply it.

Could any one please help in sharing any sample to try out the join node with reduce sequence mode ?

Regards
Arun

hi sorry - yes - there is a simple example in the info box on the right.

eg for a numeric sequence

  • Reduce expression : $A+payload
  • Initial value : 0
  • Fix-up expression : $A/$N

will calculate the average

[{"id":"76a25a40.65e4b4","type":"inject","z":"e0631187.0034b","name":"","topic":"SEQ","payload":"[1,2,3,4,5,6,7]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":500,"wires":[["96eda174.02c0c"]]},{"id":"96eda174.02c0c","type":"split","z":"e0631187.0034b","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":330,"y":500,"wires":[["a5c77f8d.77477"]]},{"id":"a5c77f8d.77477","type":"join","z":"e0631187.0034b","name":"","mode":"reduce","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"$A+payload","reduceInit":"0","reduceInitType":"num","reduceFixup":"$A/$N","x":470,"y":500,"wires":[["1c44a85f.c09988"]]},{"id":"1c44a85f.c09988","type":"debug","z":"e0631187.0034b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":500,"wires":[]}]

Thanks for your quick response.

Regards
Arun

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