Closed mithunmanohar closed 8 years ago
Hi @mithunmanohar79, ParseJson
parses recursively so {"d":456}
has been parsed into a Dictionary
and you can use Keys
/Items
to get the keys/values out of it. If you want to print the whole Dictionary
out, you can use MsgBox WebHelpers.ConvertToJson(Json("c"))
which converts the Dictionary
back into a json object string.
Thanks @timhall for your quick reply !
Hi, I am trying to parse a json response from web service like below. Dim Json As Object Set Json = WebHelpers.ParseJson ("{""a"":123,""b"":[1,2,3,4],""c"":{""d"":456}}")
I would like to print out the value of key 'c' ie {""d"":456}.
But when I try to access it like MsgBox Json("c"), I am getting an argument not optional error. I cannot specify the key to get the elements as the key in response varies from time to time.
It would be great if any body can help me figure out how to get this done.