Json inspector question

How would I retrieve the value (which is 0) of the key circle?

q: json of file "c:\temp\test.json"
A: {"location":"texas","type":[{"circle":0,"square":4,"triangle":3}]}
T: 1.495 ms
I: singular json value


q: values of key "type" of json of file "c:\temp\test.json"
A: [{"circle":0,"square":4,"triangle":3}]
T: 0.760 ms
I: plural json value
1 Like

I think the trick is to understand that the [ values ] are in fact an Array, and you have to address them with either “elements of” or “element 0 of”

q: json of "{%22location%22:%22texas%22,%22type%22:[{%22circle%22:0,%22square%22:4,%22triangle%22:3}]}"
A: {"location":"texas","type":[{"circle":0,"square":4,"triangle":3}]}
T: 0.166 ms
I: singular json value

q: values of key "type" of json of "{%22location%22:%22texas%22,%22type%22:[{%22circle%22:0,%22square%22:4,%22triangle%22:3}]}"
A: [{"circle":0,"square":4,"triangle":3}]
T: 0.124 ms
I: plural json value

q: elements of values of key "type" of json of "{%22location%22:%22texas%22,%22type%22:[{%22circle%22:0,%22square%22:4,%22triangle%22:3}]}"
A: {"circle":0,"square":4,"triangle":3}
T: 0.130 ms
I: plural json value

q: values of keys "circle" of elements of values of key "type" of json of "{%22location%22:%22texas%22,%22type%22:[{%22circle%22:0,%22square%22:4,%22triangle%22:3}]}"
A: 0
T: 0.137 ms
I: plural json value

q: value of key "circle" of element 0 of values of key "type" of json of "{%22location%22:%22texas%22,%22type%22:[{%22circle%22:0,%22square%22:4,%22triangle%22:3}]}"
A: 0
T: 0.144 ms
I: singular json value
1 Like

yes, “of element” is the answer. Thank you