Hello,
i have written some code to parse and prepare input data and use it later and my result/return code is:
...
for(..){
mapped[sku] = [name,variant,quantity];
}
...
let resultMap = {
"resultStr":resultStr,
"mapped":mapped
};
return resultMap;
the test seems to be fine: (the map is containing a key and an array with 3 values)
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/8ca43b2a-3dee-4b75-8b5f-789ec072d216.png)
i also debugged it:
return {"debug":{}.toString.call(resultMap.mapped ).split(' ')[1].slice(0, -1).toLowerCase()};
which returned: object
and also the value of the map:
return {"debug":{}.toString.call(resultMap.mapped[lastSku] ).split(' ')[1].slice(0, -1).toLowerCase()};
which returned: array
when i use it in an nother code zap (javascript) and make the input:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/f38954e2-2738-4e99-b378-3460aeb614fc.png)
and i use it like:
let curitemMap = input.itemMap;
for(let itemSku in curitemMap){
...
}
it was iterating over each letter. then i debugged and the curitemMap is a string.
So is it possible to keep my object as it was? alternative would be to pass it as json and parse it afterwards… but i think it should be possible so?
Just for info: i also asked the AI for help and it also created the code as i did.