You need to sign in to do that
Don't have an account?
Poorna Developer
JSON Deserialize and update in to custom field
Helo Everyone,
I have created two custom field named Amount__c and Connection_Id under the Object 'Order'.
And I have perform callout and get response from the endurl in the form of JSON Data.
Here, the sample JSON file:
{"data":[{"id":"2911647985786786830357753","connection_id":"291165354723552979434","name":"Simple account 1 MasterCard","nature":"card","balance":2019.4,"currency_code":"EUR", "extra":{ "iban":"DE11100110012612442222",},"created_at":"2020-08-24T05:58:45Z","updated_at":"2021-04-02T07:34:19Z"}
I need to deserialize this file and separate the Balance and connection_id from the json file and store this value in the Amount_c and Connection_Id__c in the 'Order' object.
Is there any suggestion??
Thanks in advance.
I have created two custom field named Amount__c and Connection_Id under the Object 'Order'.
And I have perform callout and get response from the endurl in the form of JSON Data.
Here, the sample JSON file:
{"data":[{"id":"2911647985786786830357753","connection_id":"291165354723552979434","name":"Simple account 1 MasterCard","nature":"card","balance":2019.4,"currency_code":"EUR", "extra":{ "iban":"DE11100110012612442222",},"created_at":"2020-08-24T05:58:45Z","updated_at":"2021-04-02T07:34:19Z"}
I need to deserialize this file and separate the Balance and connection_id from the json file and store this value in the Amount_c and Connection_Id__c in the 'Order' object.
Is there any suggestion??
Thanks in advance.
I have assuemed the below is your correct JSON:
If the above is your JSON then add the below class seperately:
Then in your actual class add the below code:
Thanks,
Maharajan.C
Greetings!
Please use the Wrapper class for creating a JSON.
Wrapper class will help you to create understandable JSON and you will manage it easily.
If you find your Solution then mark this as the best answer.
Thank you!
Regards,
Suraj Tripathi