Show firebase realtimedb object properties in listviewer

Hi all, i’m new to thunkable so sorry if i missed something from docs.

I’ve a firebase realtime db which stores some basic infos about users, categories and devices.
My db looks like this

– root
---- users
----- idUser0
------- nameFull = “User Name0”
------- nameAlias = “User0”
----- idUser1
------- nameFull = “User Name1”
------- nameAlias = “User2”
---- categories
----- idCategory0
------- name = “Category 1”
------- description = “Description for category 1”
----- idCategory1
------- name = “Category 1”
------- description = “Description for category 1”
---- devices
----- idDevice0
------- brand = “Brand”
------- model = “Model”
------- name = “Personal Phone”
------- carrier = “No Carrier”
------- user = /users/idUser0
----- idDevice1
------- brand = “Brand 2”
------- model = “Model 2”
------- name = “Work Phone”
------- carrier = “Business carrier”
------- user = /users/idUser1

In the screen “ScreenMain” i placed a block on screen open which gets /users, if error is true i show the error details in an alert, so far i’m fine.

If i don’t have error, i’ll get a json object as reply inside value block, how can i show all the nested items (isUser0 and idUser1) inside a listviewer?

Thanks in advance to all

Hi @William_T.Spears,

We have a lot of resources about this, but admittedly they are pretty dispersed. I’ll try collect a few of them and do a bit of an FAQ next week.

In the meantime, does this help you with your question?

Hi @domhnallohanlon, i tried the blocks you mentioned but it didn’t work…
or at least i coulnd’t make it work.

FirebaseDB will expose data as nested JSON Objects so i can’t cast it directly to list as i would do with a custom API which returns data stored as JSON Array. Is there a way to “extract” all the first level keys?

Hi @William_T.Spears - I’m going to start working on a larger series of tutorials on working with JSON. Keep an eye on #thunkable-cross-tutorials for new posts.


@domhnallohanlon many thanks!

1 Like