You need to sign in to do that
Don't have an account?
Nithya S 1
parse json response
Hi all,
Below is the response I receive. How can I get the value of Field__c?
Response:{"Account":"{\"attributes\":{\"type\":\"Account\",\"url\":\"/services/data/v47.0/sobjects/Account/0014T000005aUCBQA2\"},\"Field__c\":\"0010I00002L0OtaQAF\",\"Id\":\"0014T000005aUCBQA2\"}"}
When I hardcode the response as a string, then I can navigate to Field__c. But how do I convert this response body to a string in the format as String myJson = '{"Account":{"attributes":{"type":"Account","url":"/services/data/v47.0/sobjects/Account/0014T000005aRZAQA2"},"Field__c":"0010I00002KzV6mQAF","Id":"0014T000005aRZAQA2"}}';
Below is the response I receive. How can I get the value of Field__c?
Response:{"Account":"{\"attributes\":{\"type\":\"Account\",\"url\":\"/services/data/v47.0/sobjects/Account/0014T000005aUCBQA2\"},\"Field__c\":\"0010I00002L0OtaQAF\",\"Id\":\"0014T000005aUCBQA2\"}"}
When I hardcode the response as a string, then I can navigate to Field__c. But how do I convert this response body to a string in the format as String myJson = '{"Account":{"attributes":{"type":"Account","url":"/services/data/v47.0/sobjects/Account/0014T000005aRZAQA2"},"Field__c":"0010I00002KzV6mQAF","Id":"0014T000005aRZAQA2"}}';
Please refer below context:
This is how the response is being received..