I have the below JSON string, which I am converting to a map and then reading the values based on the keys
str json = '{"PortalId" : "POR146",
"MemberId" : "MEM132",
"ParmContainer": [{"Key1":"First",
"Key2":"Second"},
{"Key1":"Third",
"Key2":"Fourth"}]}';
I am able to read the keys and values using the RetailCommonWebAPI::getMapFromJSONString.
The problem that I have is reading the values inside the parmContainer key. From the documentation that I found, the keys are stored as strings, and values are stored as containers. When I look inside the container, I get integer values instead of "First", "Second", "Third" and "Fourth".
while ( mapEnumerator.moveNext())
{
switch (mapEnumerator.currentKey().ToString())
{
case "ParmContainer" :
container test = mapEnumerator.currentValue();
info(conPeek(test,1));
info(conPeek(test,2));
info(conPeek(test,3));
info(conPeek(test,4));
}
}
Any ideas on how to solve this issue please?