I am wondering if i could pull all the parents and child data in firebase in list in thunkable app?
Wouldn’t you want the lists separated by data path? Otherwise you will have a list of everything?
You will likely want to parse or filter your data somehow right?
I’m also interested in something like that.
How can I retrieve the list of my bucket children ? For instance a bucket named users_list containing the list of users.
I’m not able to retrieve it either in a variable or in a list viewer. I get something like [object] [object] . I can’t understand the error.
Thanks for your reply!
it all depends on your data stucture.
for example, here is one way to do it
and here is another, equally as difficult/easy which i like better
Use a cloud variable and link a firebase database and do you can fetch all the data. Here is how i did.
Uploading a data to firebase
Guys I cannot get the point… I tried your example but it seems different from my needs. I try to explain it better:
Let’s say that I have a Firebase project “school” , then I have a list of classes , and for each class I have a list of student.
– Class A
– Class B
– Class C
– Class Z
How can I get the list of student of Class Z ? I need to save it in a variable and show the list in a list viewer.
Thanks a lot!!
Can you please let me know if students name do have definite keyname for each value?
Student John as value John , student Anne value Anne and so on…
this is my first time in creating an app, posting in a Community and using Thunkable (I started 20 days ago). I hope you will forgive my English and my mistakes.
I answer to your post because it seems to me that the topic is similar. It also seems to me that you are very experienced and maybe I can ask you for a suggestion.
With my app I would like to create a database of stores and allow users to select them by type and city.
I managed (perhaps not in the best way) to finalize the registration of the shopkeepers and to allow them to save the data of their shop.
This is an example of the shops data:
Then I have created a list of the merchants’ userIDs (which I call Tag.List)
These are the blocks that create the TagList (which works):
(I copied them from a @Darren Tutorial)
Now I would like to create some sublists: one for each type of shop, but I can’t do it.
These are the blocks that should create the sublist of a type of stores (in the database the property corresponding to the store type is “2”) but they don’t work: they always produce an empty list.
Can you help me understand where I went wrong? Thanks in advance.
Tonight I wondered why MIT App Inventor (which I tried before Thunkable) uses two different blocks to read data from a database: “GetValue” (call) and “GotValue” (receive). Maybe to give the app the time to receive the requested data? Thunkable only uses one block (Get)… so I tried to insert a pause before evaluating the answer.
And it WORKS!
Hey @bellacopia, I think the issue you were experiencing is because instructions that are nested within the purple block occur asynchronously.
More clearly put the instructions within the purple block run on their own,
so. if you were running in a straight line, and you got to a purple block with a “then do” section, your app now take two paths.
- the straight down path. The app will not only do the purple method block but then it will also execute the code immediately below the purple block once it has begun its task.
2. the ‘then do’ path This refers to the “then do” section of the purple method block.
These blocks occur asynchronously. This means that they work on their own time. Another way to think about it is, The app is now executing any code in this section plus what’s below the purple block at the same time.
That said if blocks below the method block require the code from within the method block, and your app moves too quick or the data/computations/code execution takes too long in the asynchronous “then do” section,. In other words, the app code tries to use the results of the ‘then do’ before that data is ready.
Does this make sense?
you could also make something like this. you’d put the blocks in the green box, minus the delay, below the if/'then block in the ‘then do’ section of the realtimeDB Get Call
unfortunately what you suggest me to do was my first choice, which is the first way I tried to create the selection of stores that have a given property. But it does not work. I tried and tried again for three days without getting the result, but what’s worse is that the errors were sometimes different and random, not reproducible. And this is very worrying. Thanks anyway for your help
are you sure that this produces a list of all your tags?
would this do the same?
now that I think of it, @actech has an example of this in his demo app! find that and you will find your answer
Your CreaTagLIST function that you copied from me was a big fat HACK when Thunkable was being buggy.
Try out my new preferred approach for getting lists out of firebase: