I'm trying to use the Multiple Outputs example from the Writing Functions user guide.
With the suggested example, the function keeps one single output.
var newMsg = { payload: msg.payload.toString().length };
return [msg, newMsg];
Note: I've added toString()
to convert timestamp
into a string.
A functional workaround uses node.send()
.
var newMsg = { payload: msg.payload.toString().length };
node.send(newMsg);
return msg;
Question
Does releases 1.0 and onwards change the way multiple outputs are handled by a function?
Thank you!
Initial flow
[{"id":"e32e22fd.cfc598","type":"function","z":"56997b57.3c88ac","name":"","func":"var newMsg = { payload: msg.payload.toString().length };\n\n//node.send(newMsg);\n//return msg;\n\nreturn [msg, newMsg];","outputs":1,"noerr":0,"x":270,"y":100,"wires":[["25e587dd.535e38"]]},{"id":"f207fa9f.569d38","type":"inject","z":"56997b57.3c88ac","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":100,"wires":[["e32e22fd.cfc598"]]},{"id":"25e587dd.535e38","type":"debug","z":"56997b57.3c88ac","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":480,"y":80,"wires":[]}]