I have some JSON that I need to parse, which looks like this:
Because the top level isn't an object, I am parsing it and converting it to a List like this:
That works. But then I want to convert each element in the list into a Map. I know I can use a For/Next loop to loop through the list but is there a more elegant want to do this using a For/Each loop, e.g.:
If so, what is the type of entity?
B4X:
[
{
"Id":1,
"Name":"ABC"
},
{
"Id":2,
"Name":"XYZ"
}
]
Because the top level isn't an object, I am parsing it and converting it to a List like this:
B4X:
Dim JSON As JSONParser
JSON.Initialize(Job.GetString)
Dim JSONList As List = JSON.NextArray
That works. But then I want to convert each element in the list into a Map. I know I can use a For/Next loop to loop through the list but is there a more elegant want to do this using a For/Each loop, e.g.:
B4X:
For Each JSONMap As ??? In JSONList
Next
If so, what is the type of entity?