# I'm having problems with local storage for my running total app

**URL:** <https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962>\
**Category:** Questions about Thunkable X\
**Created:** [April 25, 2022, 5:37pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962 "2022-04-25T17:37:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickwheeler1992](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@rickwheeler1992](https://community.thunkable.com/u/rickwheeler1992)\
**Post date:** [April 25, 2022, 5:37pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962/1 "2022-04-25T17:37:45Z")

</div>

So I’m making an app when a button is pushed it adds to the running total (dollar amount). I’m having problems with the local storage blocks. I don’t know what I’m doing wrong. I’m trying to use it in the test live and then I get out but when I get back in to the test live, nothing is saved. Here are my blocks.

 ![Screenshot (32)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/66defdefa3a2ded90318757a6ba3fd295283835f.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 25, 2022, 6:20pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962/2 "2022-04-25T18:20:45Z")

</div>

Part of the problem is that you seem to be using the running total value as a key. I assume you’re storing the dollar amount there. The “key” is just a location name for your value. So the key would be something like “saved total” and the “value” would be the actual numeric amount that you are keeping track of. So when you Get the value from storage, you would need the key to have the location name and the value would have the numeric value you are storing. So you’d need to set Amount 1’s Text to the green value block when the screen opens.

**But…** you should be using stored variables to save single data items or a Data Source to save table data. I’m not sure why the Local Storage block is even still available in Thunkable.

See the note at the top of the documentation for Local Storage: [Local Storage - Thunkable Docs](https://docs.thunkable.com/local-storage).

---

<div class="post-metadata">

**Author:** ![rickwheeler1992](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@rickwheeler1992](https://community.thunkable.com/u/rickwheeler1992)\
**Post date:** [April 25, 2022, 7:15pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962/3 "2022-04-25T19:15:42Z")

</div>

@tatiang thank you. It works great

---

<div class="post-metadata">

**Author:** ![rickwheeler1992](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@rickwheeler1992](https://community.thunkable.com/u/rickwheeler1992)\
**Post date:** [April 25, 2022, 8:10pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962/4 "2022-04-25T20:10:29Z")

</div>

@tatiang sorry to be a bother. It’s the last thing that I need to do and I’m done. I hope I can explain it okay. I have the same screen design and the same blocks for seven screens (copied from save my screen) I want when day one ends the amount total to begin again at zero but on day two it starts off with the total amount from day one. I’ve tried renaming the variable by adding a two after it and I day one has local storage 1 and day two has local storage 2, but it still leaves off with the total from day one.

---

<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 25, 2022, 8:22pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962/5 "2022-04-25T20:22:55Z")

</div>

My first thought when I hear that someone has multiple screens that are very similar is that it’s almost always easier and more efficient to program this all in a single screen. But if you have seven screens then that’s what you have to work with at this point.

It sounds like you need seven variables or a data source (table) that can store different values. I would use a data source unless you don’t want to bother with learning how to do that. So when day one ends, you would set the variable (or data source row) for day 2 to the variable (or data source row)'s value for day 1 and then set the variable (or data source row) for day 1 to zero.

---

<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 24, 2022, 8:23pm UTC](https://community.thunkable.com/t/im-having-problems-with-local-storage-for-my-running-total-app/1847962/6 "2022-07-24T20:23:20Z")

</div>

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