# List viewer repeating the list items each time screen is opened

**URL:** <https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870>\
**Category:** Questions about Thunkable X\
**Created:** [September 15, 2021, 1:08pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870 "2021-09-15T13:08:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikhyathkiran23y6p3s](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/vikhyathkiran23y6p3s/32/116190_2.png) [@vikhyathkiran23y6p3s](https://community.thunkable.com/u/vikhyathkiran23y6p3s)\
**Post date:** [September 15, 2021, 1:09pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/1 "2021-09-15T13:09:00Z")

</div>

Hi,  
I was trying to display a list in list viewer by using Firebase DB. Unfortunately, if I open the screen in which that list viewer is in(Read Recommendations), it duplicates the same values each time I open the screen.  
I tried clearing the list viewer before adding the list items, but no luck there!  
Here is the code:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/9/e96bb06fa64d427d52b9806ca5de7c39ffe9da1d.png)  
Please note that the value in variable ‘Book\_List’ are being saved in another variable called ‘Books\_List’.  
I have also attached the screenshot of the code in the screen where I enter the list items as well below:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/e/6efa34a59bef8d6b28fb32509355b050d32cf3a6.png)

I had read all the other community discussions similar to this but there is a slight difference: Since this is an app which can be accessed by every user, there are scenarios where the user will be giving the same values as another user had given. I do not want to clear these values. I only want to clear the values which the bug in my code has duplicated.  
Thanks in Advance,  
Vikhyath

---

<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:** [September 15, 2021, 1:12pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/3 "2021-09-15T13:12:37Z")

</div>

Reset the list not the list viewer.

You need to reset **Book\_List** to empty list.

Do this  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/197cfc08bc2b9d420e608f854c9cac645f54e5a6.png)

instead of resetting the list\_viewer

---

<div class="post-metadata">

**Author:** ![vikhyathkiran23y6p3s](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/vikhyathkiran23y6p3s/32/116190_2.png) [@vikhyathkiran23y6p3s](https://community.thunkable.com/u/vikhyathkiran23y6p3s)\
**Post date:** [September 15, 2021, 1:21pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/4 "2021-09-15T13:21:07Z")

</div>

Hi Sir,  
I tried what you said, but now nothing displays in list viewer because the variable is empty when it is displayed in list viewer since I set it to empty list.

This is the way I have changed the code as per your suggestion:

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

---

<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:** [September 15, 2021, 1:24pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/5 "2021-09-15T13:24:27Z")

</div>

This is wrong  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/a/8af57bb7eac1c4bc9b9f58ccf53685c4a3387248.png)

You should use the green block `value` instead of `app variable Book_List`. This is assuming that the result of the `Get Block` is actually a list.

---

<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:** [September 15, 2021, 1:34pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/6 "2021-09-15T13:34:26Z")

</div>

If you are sure the result of the `Get Block` is a list then all what you need is this

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

---

<div class="post-metadata">

**Author:** ![vikhyathkiran23y6p3s](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/vikhyathkiran23y6p3s/32/116190_2.png) [@vikhyathkiran23y6p3s](https://community.thunkable.com/u/vikhyathkiran23y6p3s)\
**Post date:** [September 15, 2021, 1:34pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/7 "2021-09-15T13:34:54Z")

</div>

Hi Sir,  
Firstly, thank you for your quick replies.

The green block `value` is not actually a list. It is an object containing properties:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/0/604e41acd5e409ee2c95233e2bee63960d28a44a.png)

And it is not displaying anything in list viewer

What could I do?

---

<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:** [September 15, 2021, 1:39pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/8 "2021-09-15T13:39:35Z")

</div>

The image of your Firebase means you tried to save a `List` into the DB directly  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/4/1415e95592da0b3926f22c0e8f0a75b14424ef76.png)

Firebase does not actually know how to deal with simple list and therefore it saves it and adds internal identifiers to refer to it in the correct way.

I advise you delete this entry and start fresh the appropriate way. Refer to Thunkable documentations to see how to save `lists` to the database.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:15pm UTC](https://community.thunkable.com/t/list-viewer-repeating-the-list-items-each-time-screen-is-opened/1506870/9 "2024-11-08T13:15:15Z")

</div>


