# \[Solved\] How do I display data from the RealTime Database as a list in my app?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, solved\
**Created:** [April 6, 2022, 7:00pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443 "2022-04-06T19:00:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [April 6, 2022, 7:00pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/1 "2022-04-06T19:00:23Z")

</div>

hi all  
im trying to get my data and show it in List\_Viewer from Realtime Database  
this my blocks below it work but its giving me just the last item in the data

 ![Screen Shot 2022-04-06 at 9.56.41 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/7/37862c268f3b2ccc375adda1a17207e5d485fa3c.png)

 ![Screen Shot 2022-04-06 at 10.00.55 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/2/f260da4a41330bda659df3422f3533ae31253287.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 6, 2022, 7:36pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/2 "2022-04-06T19:36:36Z")

</div>

The problem is that you are looping through your database values but setting the list viewer’s text items to a list that contains a single item.

Instead, within the loop, you need to use the [insert at last](https://docs.thunkable.com/lists#insert-at-set) block from the List drawer to add each value to the list. You’ll need a separate list variable for that.

Then, once the loop has completed (below the `for each item in list` block), you can assign the list viewer’s text items to the list variable that you used within the loop.

---

<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:** [April 6, 2022, 8:14pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/3 "2022-04-06T20:14:28Z")

</div>

![Screen Shot 2022-04-06 at 4.06.58 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/0/301bf4de8fc11dbeeaae865746bb6a693478d432.png)  
I use this same approach in one of my apps. I get the bucket (a JSON object made up of more JSON object) and assign that to a variable. Then i extract the keys from that main bucket (a list of dates) and assign that to a different variable. Then, loop through the keys and extract the desired value. a score associated with each date/key that i have in that bucket.

get property \<YOUR PROPERTY/KEY NAME\> of object (get property Key of object Bucket)

^^this loops through each object in the bucket and allows you to grab the property you want from each and throw it into a list to display in your list viewer

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 6, 2022, 9:31pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/4 "2022-04-06T21:31:54Z")

</div>

Your block should look like this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/6/c6f08f4a15b44994ab67dae32d041e36b493c18b.png)

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [April 7, 2022, 4:48pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/5 "2022-04-07T16:48:22Z")

</div>

Thank you all for helping

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [July 6, 2022, 4:49pm UTC](https://community.thunkable.com/t/solved-how-do-i-display-data-from-the-realtime-database-as-a-list-in-my-app/1821443/6 "2022-07-06T16:49:07Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
