How can I take this value from firebase as a list to show it in a list viewer
This is not working
How can I take this value from firebase as a list to show it in a list viewer
This is not working
Firebase will return an object not a list so use the methods in the object drawer.
Note
It is always a good practice to first check for errors before proceeding with reading values
Ok, Thanks @muneer
Can you please share a screenshot of getting this values using the objects block?
actually I have never used those.
Will do it later when I’m in front of the computer
Ok, please send it by today
The link below shows how to get and set nested values from a firebase json tree. Basically, use a slash to separate nodes in the tree.
How can I use this method to get the values in a list form?
@drted How can I get all the values from that list? Like if it has 12 participants it will all of them but if it has 5 participants then it will take those 5?
I have figured it out!!
Here app extra is the number of participants (counting from 0 not 1) and the textinput holds the first key. And the list is getting saved in the app temporary list.
Excellent! I’m glad to have a better understanding of how firebase works.
Something to consider, you can do the same thing with these 2 blocks:
Fewer blocks and it will run much faster!
Wow, that’s great. That means in place of Firebase DB I can use an cloud variable. Am I right?
100%
Great,
The list is practical in this case because you have only names but when you have something like user name and email address then you will need to look at it as a JSON object instead if a list
I made a quick app and used similar entries in you DB to simulate the situation. The [get object properties of] will list the numbers that are not shown if you use the list.
Hope that clarifies why sometimes you need to look at at as a list and another time as an object of a list.
Hey @muneer and @drted thanks for helping me out!! Just a quick question, that if I create a cloud variable will it be saved in firebase DB? and can I take that data using the same cloud variable?
If you have the Web API Key and Database URL set in the project setting page then it will be saved to your Firebase DB.
In case you have not supplied your database credentials, then it will be saved in the cloud storage of Thunkable cloud which is temporary only.
Hope to have answered you.
Ok, Thanks