Hi,
I have a large amount of JSON being returned from a 3rd party. One of the attributes has pipe delimited list rather than in separate objects.
I would like to convert
"options": "0001|black|o0002|red|0003|gold"
to
"options": [{
"refcode": "0001",
"name": "black",
"inStock": "1"
},
{
"refcode": "0002",
"name": "red",
"inStock": "0"
},
{
"refcode": "0003",
"name": "gold",
"inStock": "1"
}]
is it possible to loop through the arrays to convert this JSON on an object?
thanks