# Local db data not persistent

**URL:** <https://community.thunkable.com/t/local-db-data-not-persistent/297155>\
**Category:** Questions about Thunkable X\
**Created:** [October 31, 2019, 10:23am UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155 "2019-10-31T10:23:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![DouglasRussell](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DouglasRussell](https://community.thunkable.com/u/DouglasRussell)\
**Post date:** [October 31, 2019, 10:23am UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/1 "2019-10-31T10:23:26Z")

</div>

Hello everyone. Hope someone can steer me in the right direction. I have an app that scans a barcode and retrieves the barcode information from an API (in this case an ISBN from a book). I display the book’s information and give the user the option of saving the book to a local db table. Later on, the user can open a list of books that he or she has saved. This data should be persistent, and should not disappear when the app has been closed and then reopened. Everything is working except the data is not persistent and disappears if I close the app and reopen it. Here are my blocks:

 ![booklisting](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/2/b2583c15ccb968107540d00eda0486ea23fa73f7.jpeg)

What am I doing wrong?

Thanks for the help!

Doug

---

<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:** [October 31, 2019, 10:48am UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/2 "2019-10-31T10:48:34Z")

</div>

Hello,

Store data locally between sessions can only stored variables and component Local Storage.

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [October 31, 2019, 10:49am UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/3 "2019-10-31T10:49:44Z")

</div>

Hi Doug! 👋

I recommend you to choose **`local_storage`** instead of localDB.  
LocalDB works for the current current session of your App.

Thanks! 😊

---

<div class="post-metadata">

**Author:** ![DouglasRussell](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DouglasRussell](https://community.thunkable.com/u/DouglasRussell)\
**Post date:** [October 31, 2019, 11:48am UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/4 "2019-10-31T11:48:55Z")

</div>

Thanks, I’ll give that a try!

---

<div class="post-metadata">

**Author:** ![DouglasRussell](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DouglasRussell](https://community.thunkable.com/u/DouglasRussell)\
**Post date:** [October 31, 2019, 11:54am UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/5 "2019-10-31T11:54:09Z")

</div>

I’ll be using the ISBN of each book as a key and the title as the value. How would I retrieve the data for the list viewer? What I would like to do is something like my original blocks, looping through all the data and populating the list that way. How would you do that without specifically knowing the key?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![DouglasRussell](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DouglasRussell](https://community.thunkable.com/u/DouglasRussell)\
**Post date:** [October 31, 2019, 12:49pm UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/12 "2019-10-31T12:49:47Z")

</div>

All right, so here is my simple work around.

I just use a stored list. Not sure why I didn’t think of this before. The data is persistent. Not sure what the size limit on the list might be…I’ll let you know if I reach it.

 ![sol](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/b/fb6b874de7659a2529e09cf474a4e6b8b1c09616.jpeg)

Doug

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [October 31, 2019, 1:04pm UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/13 "2019-10-31T13:04:40Z")

</div>

> [@DouglasRussell](#):
>
> Everything is working except the data is not persistent and disappears if I close the app and reopen it

That sounds unusual @DouglasRussell

Can you tell us a bit more about the conditions so we can try recreate this error on our end?

i.e: Live Testing or installing your app?  
Android and/or iOS?

Thanks.

---

<div class="post-metadata">

**Author:** ![DouglasRussell](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DouglasRussell](https://community.thunkable.com/u/DouglasRussell)\
**Post date:** [October 31, 2019, 1:40pm UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/14 "2019-10-31T13:40:17Z")

</div>

Sure thing. In live testing (latest Android version), everything works fairly well using the AddRow block in the Local\_DB. Data gets stored, and is retrievable. When I exit live and then come back, the data is gone. I thought maybe this was just a “live thing”, so I downloaded my app and tested it, same issue. I haven’t test it on iOS yet.

Doug

---

<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, 12:08pm UTC](https://community.thunkable.com/t/local-db-data-not-persistent/297155/15 "2024-11-08T12:08:32Z")

</div>


