Check several msg.payload inputs in one function node?

Hi,
is it possible to check/combine more than one inputs (all of them msg.payload) in one funktion node ?

Like:
msg.payload = input1.msg.payload + input2.msg.payload + input3.msg.payload

BR
Gawan

Not directly. Each message arrives as a separate call to the function node.

One approach is to use the Join node to combine the separate messages into one, which you can then pass to the Function node.

Another would be to store each message in the Functions local context and only do the processing once you know you're received all of them.

There is an example of using the Join node for this in the node red cookbook.
https://cookbook.nodered.org/basic/join-streams

1 Like