What am I doing wrong?

Why is the top inject not being routed to top debug node?
image
image

[{"id":"c82cdbdd3cd2858e","type":"inject","z":"d760e2801b9ca31b","name":"t","props":[{"p":"payload"},{"p":"payload.init","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":450,"y":440,"wires":[["feb42620f9c78f42"]]},{"id":"3db68cff3103c40b","type":"inject","z":"d760e2801b9ca31b","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":460,"y":520,"wires":[["feb42620f9c78f42"]]},{"id":"feb42620f9c78f42","type":"switch","z":"d760e2801b9ca31b","name":"","property":"payload.init","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":480,"wires":[["6109b3a8c0bf2943"],["fccfdfb7a99db3f5"]]},{"id":"d781488b1a11604d","type":"inject","z":"d760e2801b9ca31b","name":"f","props":[{"p":"payload"},{"p":"payload.init","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":450,"y":480,"wires":[["feb42620f9c78f42"]]},{"id":"6109b3a8c0bf2943","type":"debug","z":"d760e2801b9ca31b","name":"debug top","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":470,"wires":[]},{"id":"fccfdfb7a99db3f5","type":"debug","z":"d760e2801b9ca31b","name":"debug bottom","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":520,"wires":[]}]

you can't set payload to be a number and then add a sub property to it... add a debug to the inject and see what it is sending.

1 Like

Of course I can't #LOL

I was having trouble in a real flow so knocked this up for testing and forgot Rule 1 :

image

1 Like

If you create a specific Date object then yes you can add to it...

[{"id":"34c17f2f1a31a93f","type":"inject","z":"826d685ea5de20db","name":"t2","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":460,"wires":[["0b6180836635685b"]]},{"id":"0b6180836635685b","type":"function","z":"826d685ea5de20db","name":"function 1","func":"msg.payload = new Date();\nmsg.payload.init = true;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":260,"y":460,"wires":[["bcdb1a2024a16729","feb42620f9c78f42"]]}]

.. but hey - it's a function node :wink:

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