Read data from firebase and display in List Viewer

Hi All,

I know this is the most easiest one to get the output. For some reason I am stuck in retrieving the data from firebase and display it in listviewer but I am able to send message to the firebase.

I have attached the screenshot as well as the project link.

https://x.thunkable.com/copy/9e1896e12314d25c6e5f0a5a783f37ea

Your assistance would be of great help.

Regards,
Sasi Preethascreenshot

1 Like

You are having a single entry for the key “test” and therefore you List Viewer will only show ONE item which is “HI”

Thank you for your Swift reply Muneer.

I have created 2 objects E-Mail as Hi and Phone as 9999999. It is reflecting correctly in Database under Key Test.

I see blank screen on thunkable when I click on Get Button, thus seeking help whether the code is correct or not to retreive and display it in listviewer.

1 Like

It is better to first show the “value” in a label to see if it is retrieved from the database as object or as JSON. you can then decide which code to use.

For example
image

Thank you Muneer. It shows Object.

How do I get the value in one word?

Regards,
Sasi Preetha

1 Like

If it is already an object then it could be a single object or a list. You can use the List Viewer for lists that are saved as objects but if it is just a single object then use a label in the screen and use Get property of object and mention the property such as “Email” (properties are case sensitive) and for the object use “value” directly.

Thank you Munner. It is really working and thank you very much for driving me to find it by myself…

I used delimiter and the answer is displaying with an open and close curly bracket, how do I remove it?

1 Like

You are getting curly braces because you used the block “generate JSON from object”. You do not need to convert “value”.

Use it with the List Viewer directly and without assigning “value” to anything else.

Thank you Muneer. I do not understand this.

Could you kindly help with the code?

1 Like

This is how I would go about it

First the databasename variable is not a list but a DB object so I would change to this
image

Then I will change the GET block to this

This will result in a list that has the key names; Email and Phone. So I have added another block when you select one from the list the value stored in it is displayed in a label in the screen.
image

Hope this helps.

Thank you very much Muneer for your assistance with detailed explanation along with blocks.

I made one change i.e moved the set app variable datbasename to value block from do part to else part.

It works.

Thanks again for your time and assistance. Much Appreciated!. Take Care.

1 Like