So strange... Switch nodes taking advantage of JSONata as a criterion for any output seem to cease passing on ALL messages on ALL outputs should msg.parts
get set. This is happening irrespective of the nature of any of the comparisons-- even the tautologic msg.payload == msg.payload
is failing.
Similarly, outputs gated as "otherwise" are silent, even when none of the other outputs pass a message. Nor does the problem seem to be related to JSONata specifics as any valid expression seems to be enough to trigger the problem.
There are no error messages, nor have I been able to see anything amiss in the logs, even turned up to "trace".
Specifically, the node only seems to fail if both msg.parts.id
and msg.parts.index
are set. Their values don't seem to matter. Slightly tweaking the either of the names of the properties (msg.parts.idx
for example) causes the effect to disappear. The rest of the typical content of msg.parts
does not seem to have any effect.
Please help? I cannot figure this one out... If anyone can spot what I'm doing wrong or what is going on, I'd be extremely grateful!! Or, if anyone can verify this behavior I would also very much appreciate it.
Thank you in advance!
Example flow:
[{"id":"5d0cb663.4aa908","type":"switch","z":"a7574de8.bfab9","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"payload","vt":"msg"},{"t":"jsonata_exp","v":"true","vt":"jsonata"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":710,"y":320,"wires":[["eb1805b1.965398"],["bf6110fe.2370d"],["3f0c7057.aec39"]]},{"id":"6ed41ff2.3317c","type":"inject","z":"a7574de8.bfab9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":220,"wires":[["1aa17f3f.bfadc1"]]},{"id":"eb1805b1.965398","type":"debug","z":"a7574de8.bfab9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":280,"wires":[]},{"id":"1aa17f3f.bfadc1","type":"change","z":"a7574de8.bfab9","name":"FAILS: msg.parts.id & msg.parts.index set","rules":[{"t":"set","p":"parts","pt":"msg","to":"{\"id\":\"a\", \"index\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":220,"wires":[["5d0cb663.4aa908"]]},{"id":"bf6110fe.2370d","type":"debug","z":"a7574de8.bfab9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":320,"wires":[]},{"id":"3f0c7057.aec39","type":"debug","z":"a7574de8.bfab9","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":360,"wires":[]},{"id":"c96495d4.7fe748","type":"inject","z":"a7574de8.bfab9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":280,"wires":[["c57441d5.732aa"]]},{"id":"c57441d5.732aa","type":"change","z":"a7574de8.bfab9","name":"works: msg.partz","rules":[{"t":"set","p":"partz","pt":"msg","to":"{\"id\":\"a\", \"index\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":280,"wires":[["5d0cb663.4aa908"]]},{"id":"44d93e92.4f001","type":"inject","z":"a7574de8.bfab9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":340,"wires":[["26b55b4f.0a1434"]]},{"id":"26b55b4f.0a1434","type":"change","z":"a7574de8.bfab9","name":"works: msg.parts.idd","rules":[{"t":"set","p":"parts","pt":"msg","to":"{\"idd\":\"a\", \"index\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":340,"wires":[["5d0cb663.4aa908"]]},{"id":"6e08752d.de033c","type":"inject","z":"a7574de8.bfab9","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":400,"wires":[["cec94657.3987c8"]]},{"id":"cec94657.3987c8","type":"change","z":"a7574de8.bfab9","name":"works: msg.parts.indexx","rules":[{"t":"set","p":"parts","pt":"msg","to":"{\"id\":\"a\", \"indexx\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":400,"wires":[["5d0cb663.4aa908"]]}]