Store a json object in variable

If anybody have any idea please share..How to Store a json object in variable?
actually i have a json object like:

{
"employees":[
    {"firstName":"John", "lastName":"Doe"}, 
    {"firstName":"Anna",	"lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}
]
}

i want to store it in a variable. like:
employeedetails = “employees”:[
{“firstName”:“John”, “lastName”:“Doe”},
{“firstName”:“Anna”, “lastName”:“Smith”},
{“firstName”:“Peter”, “lastName”:“Jones”}
]
if i store it direct(in employeedetails) like above example it give me syntax error.

You need to retain the outermost curly brackets to make it an AssociativeArray.

–Mark

In the 6.x firmware, you can’t have quoted key names, so you’d likely need to use ParseJSON to convert the JSON string to an AssociativeArray.

“chandu” wrote:
If anybody have any idea please share..How to Store a json object in variable?

If the use case is that you are getting a JSON string from somewhere (like a web service) that you want to work with,
then the answer is to use the ParseJSON function to convert it to a BrightScript object representation.

ParseJSON will also handle things like embedded quotation marks and escape sequences in string values, null values, etc., and it will automatically handle the keys as case-sensitive / case-preserving.