(SOLVED) Jsonata Change Node: inconsistent behaviour

Using: NR v1.0.3 on RPi4 Raspbian Buster

I'm trying to correct some data in a global object (energy.dailyLog.usage) which is an array of 676 objects.

The attached flow shows a Jsonata Change node (Fix usage) which works perfectly on test data and injected json data (via inject2). The injected data is exactly the same as that in energy.dailyLog.usage.

(Using inject1) exactly the same data output from the Function Node (payload=energy.dailyLog.usage) causes the Change Node to barf:

"Invalid JSONata expression: Argument 1 of function "substring" does not match function signature"

To fix this I have to slice the array (in the Function Node) at or below index 665. If any attempt is made to access an element past index 665 it will fail. (666 is definitely the number of the beast!)

You would think something is amiss with the array energy.dailyLog.usage but it's not the case. The json in inject2 was simply pasted from a "Copy Value" made in the Context Tab / Global.

Very grateful for any thoughts.

SOLVED: A power outage rebooted the RPi after which the problem went away. Everything now works as expected.

jsonataFlow.json (94.7 KB)

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