+ Start a Discussion
shinerajbshinerajb 

How can I get a JSONString to a list?

Hai,

 

 

How can I get a JSONString to a list?


String a=JSONString;

 

 

 

Noam.dganiNoam.dgani

create a class with an inner class.

the inner class holds the format of 1 item in your json

and the outer class contains a list of the inner class.

 

then, just use the JSON.deserialize(json, class.yourclass);

 

and you have a list

sfdcfoxsfdcfox
List<String> result = (List<String>)JSON.deserialize('{"Item 1","Item 2","Item 3"}',List<String>.class);