How can get the data stored in the JSON object?
How can get the data stored in the JSON object? I try StringObject but doesn't work.
Discussion (4)0
Comments
If you're on 2016.2+:
set json = "{""prop"":1}"
set obj = {}.%FromJSON(json)
write obj.prop
I am in 2016.1.0.
I ask how to get the data from JSON object, not from JSON.
Almost the same:
set json = "{""prop"":1}"
set obj = {}.$fromJSON(json)
write obj.prop
If you have:
set json = "{""name"":""Sara""}"
You can get the data stored :
set dynObj = ##class(%DynamicObject).%FromJSON(json)
write dynObj.name