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:
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.
object.key and object[key] accomplish the same thing, but Adobe campaign treats them differently. When you use the object.Key this works because this is hardwired as you are loading only one attribute not all. If you have to This is designed in this way read data from xml when you need it, it is more of on demand system. It is handy when we interact with broadlog(big table, lots of attributes), it loads only part which we need.
If you compare two standards for Object.keys ( O ) implementation, its algorithm is improved a lot over time
Guillermo, data is there but it's not loaded in the scope(xml) until you explicitly call it. If you are loading all the required attributes using additional data, then it will be available in XML scope.
I'm sorry but I don't fully get it. Maybe I have not explained myself properly. I think I have actually loaded the additional data on a enrichment I am using.
This is happening because your key value is not available explicitly in targetData. If you want this to work load your keyname using additional data(Additional data ) in the query then this will be available in stringify.