Is it possible to computation in node change?

I want to get the length of the array + 1, and set the value of the node change.
I have tried 2 ways as below but don't work.

If possible, please tell me. Thanks!

Yes using a JSONata expression

[{"id":"9f82063c.c6daf","type":"change","z":"4484ee28.caa3c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$count(msg.payload) + 1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":460,"wires":[["269a25ff.79887a"]]}]

$count(array) + 1

1 Like

Great!!!
Thank you very much for the support and reference link :hugs:

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