How to parse incoming JSON with Map data structure / object in it.
We have JSON response coming in below format, where under cname details, map object is mapped in JSON. Which means first tag under cnameDetails is always going to be different.
{
cnameId: "someid",
...,
cnameDetails: {
abc123: {
cnameDetailID: abc123,
serialNumbers: [...],
...,
ddd: {
attributeValues: {
...
}
}
},
cnameDetails: {
xyz123: {
cnameDetailID: xyz123,
serialNumbers: [...],
...,
ddd: {
attributeValues: {
...
}
}
}
}
Is there a way in PEGA to parse JSON with map data structure within it? For now, I'm mapping the request to string and doing string search to look for required data but is not the right thing.
In which context you are attempting to map this JSON data onto ClipboardPage? Are you using it along with Connect-REST/Service-REST rule?
BTW, there is no such map object defined in JSON specification, see : https://www.json.org/
You should be able to map this data, when you have abc123 and xyz123 types datamodel defined in cnameDetails type.