I've been having issues setting and getting data from a context variable named "Data". The variable in question is a JSON object that looks similar to this:
Data: {
{
"I.Data[0]": -51,
"I.Data[1]": -52,
"I.Data[2]": -52,
"I.Data[3]": 60
}
}
I keep trying to set individual key values inside of the variable with no luck. I think my problem is there must be a particular way to do this that is unlike accessing other JSON objects. I've tried things such as:
flow.set('Data'['I.Data[0]'], value);
flow.set('Data'.'I.Data[0]]', value);
flow.Data.set("I.Data[0]", value);
flow.set(Data."I.Data[0]", value);
All of these just error'ed out. The only thing that seems to work is creating a dummy JSON object, committing the new values to the dummy object, and then setting the entire variable to the dummy object. This of course is not only inelegant but could also problems down the road if the number of keys is large.
Any help would be greatly appreciated.
Thanks!