JSON to List Help


I am struggling to query this JSON in Thunkable X. I can do it in app inventor.

Seems like it should be a simple thing to create a list of names from “name” field from this JSON.

Does anyone have any advice.


I’m also looking for an answer to this issue. I can generate a list view if there is only a top level item in the database, but if there are children it doesn’t show anything.

Any help or pointing to an answer would be appreciated.

You’ll need to do some tutorials on lists and indexes to make sense of this. I built a small assistant that gives me weather…the code is in JSON and I had to pick each item I wanted her to speak from the list

1 Like

So far all I’ve got is the blocks below, which return me the value of “The Timber Floor Centre”. My aim is a list “Red Rooster, The Timber Floor Centre”.

1 Like

I’m still new to coding myself, but I’m not sure the “Object” blocks you have there are the best for what you’re doing. If you’re pulling from a JSON list, use the “List” blocks available. Again, you’ll have to sit down with the output and find the index numbers of each item you want. At least that’s what I was taught when doing my assistant

Try this link/tutorial for some good info about pulling items from a JSON list: Easy to decode large information with JSON format

@David_White, You’re on the right track! You probably want to create a variable somewhere and initialize it to be an empty list. Then add the value that you are currently assigning to your listofplaceslabel to that list using the 'in list __ insert at last as __' block. That way you’ll build up that list to contain all the place names.


The Object blocks were created, in large part, to support dealing with JSON results from Web APIs, so I think it’s perfectly appropriate for David to use them here. The tutorial that you’re linking to is for Thunkable Classic, which doesn’t contain Object blocks.


1 Like

ahh! That’s good to know!

Thanks Mark. These blocks are creating the list I’m after. Depending on my location the JSON will have a different number of place names. How do you think I can set it up so it figures out how many place names there are and builds the list based on that?

Hi - I’m trying to do a similar thing to this with the Google Maps Search API. I’ve currently got my blocks set up like this: it adds the first result to the list, then looks to see if there is a second result, and if there is it adds that to the list. There’s a problem though: this works for a search result that includes 2 or more places, but displays nothing (not even the first result) if only one result is returned.

Do I need a different condition for the if/then statement, or is the problem elsewhere? Any ideas/help would be hugely appreciated.


Looking at the JSON that you posted in your initial message it looks like the ‘results’ property is returning a list. Consequently, you can use any of the list blocks (e.g. 'length of') on the value returned by your 'get property results of object' block.

BTW, you can tell from the JSON string that the ‘results’ property is returning a list because it begins with an open square bracket (i.e. “[”).

As a further note, while your 'get property 0 of object', 'get property 1 of object' blocks work on the list (due to the way that the lists are implemented) it would be safer and more clear to use 'in list __ get # 1', 'in list __ get # 2' blocks instead. Note that when you refer to the items as a list, the items start at 1, rather than at 0 when you refer to them as an object property.

Hope this helps.

Happy Thunking!


1 Like

This solved my problem too - thanks Mark!