You need to sign in to do that
Don't have an account?

Have to read below JSON Structure
Hi All,
Can anyone help me in reading JSON Structure through Apex. I need to find the value of "D".
{
"A" : [{
"B" : "C",
},
{
"B" : {
"D" : "E"
}
}]
}
Thanks,
Raji M
Can anyone help me in reading JSON Structure through Apex. I need to find the value of "D".
{
"A" : [{
"B" : "C",
},
{
"B" : {
"D" : "E"
}
}]
}
Thanks,
Raji M
Your JSON is not valid firstly please remove ',' after "B" : "C" from your JSON and then remove extra spaces from your JSON.
For remove extra spaces follow this link:
https://codebeautify.org/remove-extra-spaces
Try this to extract the value of D from your JSON:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
All Answers
Please refer the below link.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_json_jsonparser.htm
https://developer.salesforce.com/forums/?id=9060G000000BhCbQAK
https://salesforce.stackexchange.com/questions/9328/how-to-parse-the-json-object-in-salesforce
Thanks
Your JSON is not valid firstly please remove ',' after "B" : "C" from your JSON and then remove extra spaces from your JSON.
For remove extra spaces follow this link:
https://codebeautify.org/remove-extra-spaces
Try this to extract the value of D from your JSON:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi