How to retrieve values from nested json structures (Maps)



And again, open the values…

(I think it clear, the parser is happy (so far, anyway))




hey, now i see it. that key is not directly at the root of parsedJson but few levels deep, in data.blah



NOW you’re on target!


@Russ_Thomas sorry,boss. from the dumbphone the debug is hard.but there is the key, the variable should be properly traversed to reach the right key


so, I’m not nearly as technical as all that…something like[0].biometricsEnabled ?


@Amanda_Perkins1 yah. sort of. you have to reach that key at the right position. sorry, i am from the phone so is hard to post a working code, but you got the picture


Yep. I’d try that or something similar. I don’t do enough map-delving to keep it in my head. :frowning:


maping is always confusing … i’ve been hit many times


well, now it just hates me because java.lang.String cannot be cast to java.lang.Integer


You might try tinkering with this:

Map data = // or parsedJson["data"]
boolean thing = data["biometricsEnabled"] // or whatever

Or did I miss a step there… I think you see where this is going though.



OMG!! Thanks Guys!!


one step at a time :)))
hidden may be tha path of maps …


Well, it worked for that particular one, yes. Now, to see if I can figure out another one that’s in a different level…



at least, now you know how to debug it :slight_smile:


Good point.

@Amanda_Perkins1 It’s a good idea (esp. with awkward stuff like this) to review your work in the debugger: “Is this really doing what I think it’s doing?”


Absolutely. So, I learned at least 3 new things today. And that’s going to come in handy later!!

  1. Russ is a pedantic old fool.
  2. Ibus can’t type for shit on his phone.
  3. Amanda is way more techie than she thought she was.

Your work here is done, I think :wink: