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))

image

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

1 Like

Ha!

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

1 Like

so, I’m not nearly as technical as all that…something like

parsedJson.data[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 = parsedJson.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.

1 Like

THAT WORKED!!!

OMG!! Thanks Guys!!

3 Likes

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…

mwahahaha

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

1 Like

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!!

2 Likes
  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:

2 Likes