Hi There,
I'm just playing around with a broken JSONata expression: $match($$.payload, /./,-1)
- the error here is "Invalid JSONata expression: Argument 1 of function "match" does not match function signature"
That is what I get from the change & switch nodes, however with the inject node I get [object Object]
as error message:
it should really be the same as from the change and switch nodes. I've done nothing special in the inject node:
Another an inconsistency that all errors are exceptions except when the JSONata is used as a property retrieval in a switch node:
that's responsible for the yellow warning message in the debug log in the screenshot.
This was all done with NR 4.0.5.
[{"id":"13856856d2486190","type":"inject","z":"b2fcc5806b2715c0","name":"","props":[{"p":"payload"},{"p":"matchresult","v":"$match($$.payload, /./,-1)","vt":"jsonata"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"111","payloadType":"str","x":468,"y":603,"wires":[["3c34ef77a739bce7","b81d8f30282eb38d"]]},{"id":"b644be4896201b62","type":"change","z":"b2fcc5806b2715c0","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$match($$.payload, /./,-1)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":719,"y":827,"wires":[[]]},{"id":"dcdfd47201e8d434","type":"inject","z":"b2fcc5806b2715c0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":492,"y":720,"wires":[["b644be4896201b62","9d10f985e3d921e1","9edc98ee837ebbde","4397b7eba0ebeefb"]]},{"id":"9d10f985e3d921e1","type":"switch","z":"b2fcc5806b2715c0","name":"","property":"$match($$.payload, /./,-1)","propertyType":"jsonata","rules":[{"t":"eq","v":"","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":658,"wires":[[]]},{"id":"9edc98ee837ebbde","type":"switch","z":"b2fcc5806b2715c0","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"$match($$.payload, /./,-1)","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":1,"x":810,"y":722,"wires":[[]]},{"id":"4397b7eba0ebeefb","type":"switch","z":"b2fcc5806b2715c0","name":"","property":"payload","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"$match($$.payload, /./,-1)","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":1,"x":868,"y":782,"wires":[[]]}]