Hi all,
I feel I am getting the syntax wrong when trying to combine these two nodes into one function node.
The first node sets the payload to JSON $moment().tz("Europe/London").format("ddd DD/MM/YYYY HH:mm:ss")
The second function node appends the message:
msg.payload = (msg.payload + " Battery level at 75% "); return msg;
I'd like to reduce clutter and make it work with only one function node.
But this does not work:
msg.payload = (($moment().tz("Europe/London").format("ddd DD/MM/YYYY HH:mm:ss")) + " Battery level at 75% "); return msg;
Flow exported:
[{"id":"476ec4eb.518bdc","type":"function","z":"3b92f612.6f7b5a","name":"Battery level 75%","func":"msg.payload = (msg.payload + \" Battery level at 75% \");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1770,"y":1830,"wires":[["b3a323f1.d0188"]]},{"id":"e3b25975.cd1ec8","type":"change","z":"3b92f612.6f7b5a","name":"Add time","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment().tz(\"Europe/London\").format(\"ddd DD/MM/YYYY HH:mm:ss\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1580,"y":1830,"wires":[["476ec4eb.518bdc"]]}]
Any help would be appreciated.