deserialize json da...
 
Notifications
Clear all

[Solved] deserialize json data records into a list

2 Posts
1 Users
0 Likes
366 Views
Posts: 205
 CWL
Admin
Issue starter
(@cwl)
Member
Joined: 11 years ago

How to deserialize json body data received from a REST Response into a list?

Issue Tags
1 Reply
Posts: 205
 CWL
Admin
Issue starter
(@cwl)
Member
Joined: 11 years ago
// received json:
jsonBody = '[{"pnm__c":"pname1", "material__c":"materialname1"}, {"pnm__c":"pname2", "material__c":"materialname2"}]';

// object Data__c records coming from json into a list
List dList = (List) System.JSON.deserialize(jsonBody, List.class);
System.debug('dList : ' + dList);
Reply
Share: