# How can i pull all data in firebase to list in thunkable?

**URL:** <https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320>\
**Category:** Questions about Thunkable X\
**Created:** [March 19, 2020, 10:14am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320 "2020-03-19T10:14:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![shemanta.bhattarai18](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shemanta.bhattarai18/32/60638_2.png) [@shemanta.bhattarai18](https://community.thunkable.com/u/shemanta.bhattarai18)\
**Post date:** [March 19, 2020, 10:14am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/1 "2020-03-19T10:14:20Z")

</div>

I am wondering if i could pull all the parents and child data in firebase in list in thunkable app?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 19, 2020, 11:54am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/2 "2020-03-19T11:54:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![alfopietro](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@alfopietro](https://community.thunkable.com/u/alfopietro)\
**Post date:** [March 19, 2020, 10:02pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/3 "2020-03-19T22:02:25Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 19, 2020, 10:27pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/4 "2020-03-19T22:27:15Z")

</div>

it all depends on your data stucture.

for example, here is one way to do it

> [@How to make a To Do App and store it on Firebase (Firebase to List viewer)](http://community.thunkable.com/t/how-to-make-a-to-do-app-and-store-it-on-firebase-firebase-to-list-viewer/503271):
>
> Good morning thunkers! I wanted to share an app I recently completed! This can be used to share ideas between teams working on the same tasks. First: Here is a link to my app! Please let me know how we can make it better! [https://x.thunkable.com/copy/4eab8e5a3b8c92dcdfaaf7ee0bb05b4c](https://x.thunkable.com/copy/4eab8e5a3b8c92dcdfaaf7ee0bb05b4c) I am already thinking of using dynamic columns/rows for a ‘prettier’ feel to the entire thing plus specifically the ability then to cross out a task prior to deleting it from the list altogether. First: I found t…

and here is another, equally as difficult/easy which i like better

> [@Jared's Cloud to-do app](http://community.thunkable.com/t/jareds-cloud-to-do-app-components-cloud-variable-diy-extended-listviewer-recursive-functions-dynamic-labels-realtimedb-authentication/502646/5):
>
> [https://x.thunkable.com/copy/e90b2cc84b663900e9a5b9ab182e50de](https://x.thunkable.com/copy/e90b2cc84b663900e9a5b9ab182e50de) UPDATE 2: I replaced the 2 ‘count by’ blocks with recursive functions and this sped up the creation and population of cloned rows and dynamic text. I added a timer to show how long this takes. I think part of the delay is the clone block itself. Some of the delays are derived from the delay between phone and the realtimeDB. Check them out! [Screen Shot 2020-03-12 at 9.40.54 PM]

---

<div class="post-metadata">

**Author:** ![shemanta.bhattarai18](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shemanta.bhattarai18/32/60638_2.png) [@shemanta.bhattarai18](https://community.thunkable.com/u/shemanta.bhattarai18)\
**Post date:** [March 20, 2020, 7:58am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/5 "2020-03-20T07:58:23Z")

</div>

Hi there,  
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

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e1328f922a623b0270b47a375af86eb9ba310bf5.png)

Retrieving data  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/1/e1e3609507b48478f95fc5d465e2c561c6abc4d2.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 20, 2020, 11:15am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/6 "2020-03-20T11:15:45Z")

</div>

Nice work!!!

---

<div class="post-metadata">

**Author:** ![alfopietro](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@alfopietro](https://community.thunkable.com/u/alfopietro)\
**Post date:** [March 20, 2020, 1:54pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/7 "2020-03-20T13:54:32Z")

</div>

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.

- School  
– Class A  
– Class B  
– Class C  
– Class Z  
----John  
---- Anne  
---- Peter

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!!

---

<div class="post-metadata">

**Author:** ![shemanta.bhattarai18](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/shemanta.bhattarai18/32/60638_2.png) [@shemanta.bhattarai18](https://community.thunkable.com/u/shemanta.bhattarai18)\
**Post date:** [March 20, 2020, 2:29pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/8 "2020-03-20T14:29:24Z")

</div>

Can you please let me know if students name do have definite keyname for each value?

---

<div class="post-metadata">

**Author:** ![alfopietro](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@alfopietro](https://community.thunkable.com/u/alfopietro)\
**Post date:** [March 20, 2020, 2:31pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/9 "2020-03-20T14:31:32Z")

</div>

Student John as value John , student Anne value Anne and so on…

---

<div class="post-metadata">

**Author:** ![bellacopia](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bellacopia](https://community.thunkable.com/u/bellacopia)\
**Post date:** [March 21, 2020, 12:14pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/10 "2020-03-21T12:14:03Z")

</div>

Buongiorno,

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:

 ![FireBase_DB](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f690c3c0e032604eb283abd76a1aab5b06edf55e.png)

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):

 ![Crea_TagLIST](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/a/3acf0c9ebc4822e7ff8e92818921258fd38c1e8a.png)

(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.

 ![Crea_SubLIST](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/0/c0e51cf925a3fe930cd272298edd61781d7b1b73.png)

Can you help me understand where I went wrong? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![bellacopia](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bellacopia](https://community.thunkable.com/u/bellacopia)\
**Post date:** [March 22, 2020, 10:43am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/11 "2020-03-22T10:43:53Z")

</div>

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.

 ![SOLVED_LI](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/15e04ec7116186f2ea54e867283ebd18b7ce8c8d.jpeg)

And it WORKS!

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 22, 2020, 1:51pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/12 "2020-03-22T13:51:50Z")

</div>

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.

1. **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.

 ![Screen Shot 2020-03-22 at 9.31.10 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/70dc209767de0229d9001bf753689b6fc75facd2.png)

**2. the ‘then do’ path** This refers to the “then do” section of the purple method block.  
 ![Screen Shot 2020-03-22 at 9.33.37 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/a/ea5aff35be54f9ef70cd198ae41047b0bcb4a4d3.png)

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

 ![Screen Shot 2020-03-22 at 9.23.53 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b9acbdb11b45a5aec268d9b9eabf6749dd82a728.png)

---

<div class="post-metadata">

**Author:** ![bellacopia](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bellacopia](https://community.thunkable.com/u/bellacopia)\
**Post date:** [March 23, 2020, 11:40am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/13 "2020-03-23T11:40:16Z")

</div>

Hi Jared,

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

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 23, 2020, 5:26pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/14 "2020-03-23T17:26:37Z")

</div>

> [@bellacopia](#):
>
> s 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 ver

are you sure that this produces a list of all your tags?

would this do the same?

 ![Screen Shot 2020-03-23 at 1.13.29 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a869e61b9ad11228ede15ec99d31b5f05f38b7b2.png)

now that I think of it, @actech has an example of this in his demo app! find that and you will find your answer

---

<div class="post-metadata">

**Author:** ![darren](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren/32/69854_2.png) [@darren](https://community.thunkable.com/u/darren)\
**Post date:** [March 24, 2020, 2:03pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/15 "2020-03-24T14:03:13Z")

</div>

> [@bellacopia](#):
>
> (I copied them from a @Darren Tutorial)

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:  
[![](https://dl.dropboxusercontent.com/s/qfm9ddab8uc4ymy/How%20to%20Display%20a%20List%20from%20Firebase%20in%20a%20Thunkable%20List%20Viewer.png?dl=0) ](https://dl.dropboxusercontent.com/s/qfm9ddab8uc4ymy/How%20to%20Display%20a%20List%20from%20Firebase%20in%20a%20Thunkable%20List%20Viewer.png?dl=0)

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [August 30, 2020, 5:36pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/16 "2020-08-30T17:36:55Z")

</div>

I know this is a bit late, but I came up with a solution to both propblems: how to access a firebase database and how to extract from a JSON hierarchy.

Notice that loading is a two step process 1) Use the SAVE block to initilize the object on firebase (weird, but necessary). Then you can reference the object using the set block to populate the variable. Now the firebase data is accessible using thunkable VARIABLE blocks. No need to use the Get and save blocks.

You can access the data using the variable blocks, but that doesn’t address how to drill down deep into the hierarchy. The GetProperty function resolves that issue. The KeyPath parameter works just like in MIT App Inventory. Object are specified using the name, and list are accessed using the position (0 is the first position). The GetProperty function works on firebase and local JSON objects.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/5/5578ee912d30df7328a7cb39efc31bf8bbb6fee7.png)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/e/0ea27f6555f2de48aed8dbf4c658a68b61481390.png)

---

<div class="post-metadata">

**Author:** ![shirohin6](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shirohin6](https://community.thunkable.com/u/shirohin6)\
**Post date:** [September 23, 2020, 2:40pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/17 "2020-09-23T14:40:14Z")

</div>

Hi All,

Thank You for the insights. I tried following them but am not able to get data from Firebase although am able to successfully sent it to firebase. Kindly see the code at

[https://x.thunkable.com/copy/1937e97eee08625cc68b53f8dd56c2de](https://x.thunkable.com/copy/1937e97eee08625cc68b53f8dd56c2de).

What ever data I save in Firebase, I want to retrieve ALL that data at different times, by clicking on BACK button.

I will be really grateful if any one of you can help.

thank in advance.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [September 23, 2020, 3:13pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/18 "2020-09-23T15:13:48Z")

</div>

To find a problem, display the values of blocks and errors on the screen to identify the block that contains incorrect data.

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [September 23, 2020, 5:35pm UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/19 "2020-09-23T17:35:33Z")

</div>

I took a look at your project.

I was having a little trouble following what you were trying to do with your blocks. I added a few block for the LONG CLICK events that save data to a cloud variable then retrieve it into the list control. I Think that is what you were trying to do.

You might also try getting the screen to work using either APP or STORED variables, then move them to the cloud. That way you can determine if the problem is with the cloud/firebase connection or your other blocks.

I hope that helps.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/8/780aaa4fc8cfccc8fb1e3d4fc58ba8eb22a4918a.png)

---

<div class="post-metadata">

**Author:** ![shirohin6](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shirohin6](https://community.thunkable.com/u/shirohin6)\
**Post date:** [September 24, 2020, 11:34am UTC](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320/20 "2020-09-24T11:34:35Z")

</div>

Hi,

Thanks a lot for your reply. I did try exactly the way you said, but its not working for me. After long click of the Done as well as Back buttons, nothing happens.

I am able to read data into Firebase from Text\_MS1 & Text\_MS2 and also able to display data into app from Firebase however I only get the last entry displayed and am not able to display the entire list. PFA the Firebase sample data for reference.

 ![Firebase data](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c1c8b610490db36674f92a8315bafc35c0da7874.png)

[Next page](https://community.thunkable.com/t/how-can-i-pull-all-data-in-firebase-to-list-in-thunkable/523320.md?page=2)
