' "State":"KA","PostalCode":560068,"Phone":8105690988,"Status":"Open - Not Contacted",'+
' "Tags":[]},{"FirstName":"deeps","LastName":"O M","Company":"vv", '+
' "City":"Bangalore","State":"KA","PostalCode":560078,"Phone":95055556343,'+
' "Status":"Open - Not Contacted","Tags":[]} ]';String leadsJSON = JSON.serializePretty(leads);system.debug('accountsDeserialized ++ '+leadsJSON);List<lead> accountsDeserialized = (List<lead> ) JSON.deserialize(leadsJSON, List<lead>.class);system.debug('accountsDeserialized ++ '+accountsDeserialized);I have validated this json in http://json2apex.herokuapp.com/but i get this error**System.JSONException: Malformed JSON: Expected '[' at the beginning of List/Set**Let me know Where I am going wrong.
5 answers
Hi SRK,My question is how deserialize the string if there are multiple records,I can serialize the records by querying as you have suggested but how to deserialize the same?