object only partially available in delivery body within a workflow
Hi,
I am using the object targetData in a delivery of a workflow. If I try to see what's inside this object with the following code:
document.write("<pre>" + JSON.stringify(targetData) + "</pre>");I only get part of the object, not all the keys that are available.
However, the keys are perfectly available as if I show them in the way:
document.write(targetData.keyName)
And the interesting thing is that from that moment, and for any subsequent run, the key keyName is also shown in the JSON.stringify output that I mentioned above.
So, in other words, it looks like JSON.stringify(targetData) don't return anything initially on the first run, but as you start calling the individual parts of the object, then these are available to the JSON.stringify(targetData) for subsequent runs.
I have not only experienced this with JSON.stringify(targetData), but also by calling the value of the object as targetData["keyName"] . This would return undefined unless you have called before (even in a previous run) targetData.keyName.
That behaviour is looking very weird to me!
Anyone can figure out what is happening here?
Thanks in advance
Guillermo