Change Node - access Array Object


I have a global Object with array elements in there - the number of elements varies dependant on the time.

Is there a way in a Change Node to access the last element in an array ??

I am essentially trying to grab some dynamic info and put it out to a log file.

Here is a picture of the object/array in question


Currently Amber.CurrentBids has 4 elements in the array - but at the 1/2 hour and hour this gets reset to 0 and then the elements filled every 5 minutes.

So in a change node i want to set (say) msg.Amber5MinBid to global.Amber.CurrentBids."Last Array Value"

Anyway to do this or is it better with a function node ?


I have just done some messing around with jsonata instead of the global set


Appears from online reading that it should do it but does not

Also tried


No good either

but if i try


that works fine.

So i am wondering if we do not support this in NR in Jsonata ?


what about

Yep that got it - thanks for the pointer !!


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