Array Context variable,getting an array from the context

Not applicable

I have a context variable that is an array of complex objects, but when I read it comes broken.

var newArrayVar = [];
newArrayVar = context.getVariable('arrayVariable.content');


print("Lenght:"+ newArrayVar.length);
print("newArrayVar: "+ newArrayVar);
for (i = 0 ; i < newArrayVar.lenght; i++) {
   print("inside loop");
}

The expected output is something like this:

Length: 5
newArrayVar: [{....},{...},...]
inside loop
inside loop
inside loop
inside loop
inside loop

But I get this:

Lenght:348549
newArrayVar: [{....},{...},...]  //THIS IS PROPERLY PRINTED

This only happens with an array set in the context, when I just place one object, it works fine.

The object itself contains arrays inside.

0 1 971
1 REPLY 1

Can you clarify?. does this have anything to do at all with the devportal?

Are you using a JS callout?

If a JS callout, can you give me a concrete example, with real code?

What is "arrayVariable.content" ? what does it hold?