So at the highest level, jsonData is a Dictionary. It starts with {
It turns out that it is a Dictionary containing Dictionary values which in turn contain Dictionary values
So I think that the first thing is just to parse the jsonData
Dim firstLevel As Xojo.Core.Dictionary
firstLevel = Xojo.Data.ParseJSON(jsonData)
At this point we can forget about JSON. We are done with it. We have “extracted” its contents.
Now we have a Dictionary called firstLevel. It is a slightly complicated Dictionary in that all its Values are Dictionaries.
So lets go look at these entries one at a time. We know that the value of these entries are in fact Dictionaries.
For Each d2 As Xojo.Core.DictionaryEntry In firstLevel
Dim secondLevel As Xojo.Core.Dictionary
secondLevel = d2.Value
Next
But good grief! The secondLevel is a Dictionary and it happens that its Values are Dictionaries as well.
So lets go look at these secondLevel entries one at a time.
For Each d3 As Xojo.Core.DictionaryEntry In secondLevel
Dim thirdLevel As Xojo.Core.Dictionary
thirdLevel = d3.Value
Next
But finally we are getting out of this stack of Dictionaries. thirdLevel is a Dictionary but its values are just text. So we can look at them and put them in a text variable.
valueText = thirdLevel.Value("FirstName")
MsgBox(valueText)
So to combine all of this
[code]Dim firstLevel As Xojo.Core.Dictionary
firstLevel = Xojo.Data.ParseJSON(jsonData)
Dim valueText As Text
For Each d2 As Xojo.Core.DictionaryEntry In firstLevel
Dim secondLevel As Xojo.Core.Dictionary
secondLevel = d2.Value
For Each d3 As Xojo.Core.DictionaryEntry In secondLevel
Dim thirdLevel As Xojo.Core.Dictionary
thirdLevel = d3.Value
valueText = thirdLevel.Value("FirstName")
MsgBox(valueText)
Next
Next[/code]
You will see the FirstName Abdul and then Abel.