I need search the assets types in a json but mapping I have a block key that is different in all blocks. I set a variable that cointains this values but when I want to use do not retrive the things after this block key. This is the code
for (var i = 0; i < jsonResponse.items.length; i++) {
var email = jsonResponse.items[i];
var emailName = email.name;
var block = jsonResponse.items[i].views.html.slots.banner.blocks;
var blockKeys = [];
var asset = jsonResponse.items[i].views.html.slots.banner.blocks.blockKeys.assetType;
var assetName = asset.name
for (var blockKey in block) {
blockKeys.push(blockKey);
}
Write("\n\Name: " + emailName);
Write("\n\Blocks: " +(blockKeys));
Write("\n\Asset Name: " + assetName);
And this is the response
Name: Test Email Dinamico
Blocks: hmjsixa2nda,74tda2do8en
Asset Name: undefined
Someone knows what is wrong?