function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
devloper sfdcdevloper sfdc 

how to parse this string using map

How to parse json string 
{"ticket":{"item": 4, "change":  "40", "limit": 400}}


Please help

 
MKRMKR
Hi,

Try the following:
Map<String, Object> attributeMap = (Map<String, Object>)JSON.deserializeUntyped(jsonString);
Map<String, Object> ticket = (Map<String, Object>)attributeMap.get('ticket');
Integer item = (Integer)ticket.get('item');
String change = (String)ticket.get('change');
Integer limit = (Integer)ticket.get('limit');
Regards,
MKR