Sending msg object from a switch to more than one node

Hi All,

I hoped to find an already existing discussion about this but I haven't found any. The case is pretty simple: I'd like to send the output (1 single msg object) of a function node through a certain case of a switch to two other function nodes. However, only one of the target nodes gets the msg object. Is that by design? What would be the "right" way to do it?

Best regards,
r0ller

PS: Sorry, I had to edit the inital topic as I forgot to mention the switch in between...

can you please lease post your example flow?
Because it definitely should work. Here is an example and its output:

[{"id":"11ee8cec.8d0383","type":"inject","z":"f954564f.03e718","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1320,"y":3380,"wires":[["97f67fb5.23e3f"]]},{"id":"97f67fb5.23e3f","type":"function","z":"f954564f.03e718","name":"testobject","func":"msg.payload = {\n    test1:\"this is\",\n    test2:\" a test\",\n    test3:true\n};\nreturn msg;","outputs":1,"noerr":0,"x":1480,"y":3380,"wires":[["31f9668e.cb6a7a"]]},{"id":"31f9668e.cb6a7a","type":"switch","z":"f954564f.03e718","name":"","property":"payload.test3","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":1630,"y":3380,"wires":[["4dba2c7b.7e6e9c","4d30bdd2.f6ff4c"]]},{"id":"4dba2c7b.7e6e9c","type":"debug","z":"f954564f.03e718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.test1","targetType":"msg","x":1850,"y":3360,"wires":[]},{"id":"4d30bdd2.f6ff4c","type":"debug","z":"f954564f.03e718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.test2","targetType":"msg","x":1850,"y":3400,"wires":[]}]


Johannes

Thanks for the quick reply! I just wanted to close this as I realized this to be a picnic. The flow was too complicated to see the root cause. So after creating a minimal example, I realized what the problem is and there's definitely no problem with sending the msg to multiple nodes. Thanks again and sorry for the noise!

1 Like

No worries.