I see a strange error thrown by the JSONATA $toMillis() function, when I try to process a payload from the feedparser node.
- The 'article.date' field from the feedparser node seems to yield a perfect DateTime string.
- When I send it directly to a CHANGE node with "Set msg.payload to [Jsonata]$toMillis(payload) I get an error:
Invalid JSONata expression: Argument 1 of function "toMillis" does not match function signature
-When I take the payload string from the DEBUG node and INJECT it to the same CHANGE node, I get the correct result.
I'm clueless. Any suggestions ?!
Here the example flow:
[{"id":"4f58bfb4.3dbd3","type":"inject","z":"66117b0a.627124","name":"Timestamp","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2021-03-11T07:04:00.000Z","payloadType":"str","x":230,"y":940,"wires":[["abb60e71.a108e8"]]},{"id":"19791ded.25089a","type":"debug","z":"66117b0a.627124","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":670,"y":760,"wires":[]},{"id":"763dd87d.e23a68","type":"feedparse","z":"66117b0a.627124","name":"Heise","url":"https://www.heise.de/rss/heise-atom.xml","interval":"120","x":70,"y":840,"wires":[["17b52f3.021a951"]]},{"id":"17b52f3.021a951","type":"trigger","z":"66117b0a.627124","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"0","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":250,"y":840,"wires":[["19791ded.25089a","f82ddcce.bd3278"]]},{"id":"f82ddcce.bd3278","type":"change","z":"66117b0a.627124","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"article.date","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":820,"wires":[["617be7c.0f74c98","abb60e71.a108e8"]]},{"id":"617be7c.0f74c98","type":"debug","z":"66117b0a.627124","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":670,"y":820,"wires":[]},{"id":"abb60e71.a108e8","type":"change","z":"66117b0a.627124","name":"Jsonata $toMillis","rules":[{"t":"set","p":"payload","pt":"msg","to":"$toMillis(payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":880,"wires":[["ad804cbb.85b5a"]]},{"id":"ad804cbb.85b5a","type":"debug","z":"66117b0a.627124","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":670,"y":880,"wires":[]}]