You need to sign in to do that
Don't have an account?
Anil Ingle
How to deserialize json formatted data into list of class?
[
{
"currentPage":"1",
"totalPages":"37",
"showingResults":"1-10 of 776"
},
{
"rfqs":[
{
"opened":"04/17/2017",
"clientId":"5004",
"agentId":"724",
"serialNumber":"4664641342",
"opportunityId":"",
"locReqs":[
{
"1":{
"locReqId":"123456",
"product_type":"Internet",
"access_type":"20M FastE",
"SingleLineAddress1":"Street2, CA 92373",
"SingleLineAddress2":"",
"Term":"12"
},
"2":{
"locReqId":"123489",
"product_type":"Internet",
"access_type":"20M FastE",
"SingleLineAddress1":"Street3, CA 92373",
"SingleLineAddress2":"",
"Term":"12"
}
}
]
},
{
"opened":"04/17/2017",
"clientId":"5005",
"agentId":"725",
"serialNumber":"4664641341",
"opportunityId":"",
"locReqs":[
{
"1":{
"locReqId":"123412",
"product_type":"Internet",
"access_type":"20M FastE",
"SingleLineAddress1":"Street1, CA 92373",
"SingleLineAddress2":"",
"Term":"12"
}
}
]
}
]
}
]
{
"currentPage":"1",
"totalPages":"37",
"showingResults":"1-10 of 776"
},
{
"rfqs":[
{
"opened":"04/17/2017",
"clientId":"5004",
"agentId":"724",
"serialNumber":"4664641342",
"opportunityId":"",
"locReqs":[
{
"1":{
"locReqId":"123456",
"product_type":"Internet",
"access_type":"20M FastE",
"SingleLineAddress1":"Street2, CA 92373",
"SingleLineAddress2":"",
"Term":"12"
},
"2":{
"locReqId":"123489",
"product_type":"Internet",
"access_type":"20M FastE",
"SingleLineAddress1":"Street3, CA 92373",
"SingleLineAddress2":"",
"Term":"12"
}
}
]
},
{
"opened":"04/17/2017",
"clientId":"5005",
"agentId":"725",
"serialNumber":"4664641341",
"opportunityId":"",
"locReqs":[
{
"1":{
"locReqId":"123412",
"product_type":"Internet",
"access_type":"20M FastE",
"SingleLineAddress1":"Street1, CA 92373",
"SingleLineAddress2":"",
"Term":"12"
}
}
]
}
]
}
]
May I request you to please refer the below link for reference.to deserialize a JSON list in Apex.
- https://salesforce.stackexchange.com/questions/125696/how-to-deserialize-a-json-list-in-apex
I hope it will be helpful.Please mark it as best answer if the information is informative.
Best Regards
Rahul Kumar
Firstly, you need to create a Apex which will store the date of from JSON after deserialize. You can use below links to create the Apex class.
https://www.adminbooster.com/tool/json2apex
https://json2apex.herokuapp.com/
Once the class is saved in the Org you can deserialize the JSON like below:
Here "JsonToApex" is the name of teh Apex class created and "JsonString" is the variable containing JSON response in string format.
Let me know if that helps you.
BALAJI
Greetings!
You have to use JSON.deserializeUntyped for converting these type of JSON.
like- If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi