# Local storage, can I used to store multiple values

**URL:** <https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264>\
**Category:** Questions about Thunkable X\
**Created:** [April 28, 2021, 8:32pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264 "2021-04-28T20:32:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 28, 2021, 8:32pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/1 "2021-04-28T20:32:58Z")

</div>

I need to store a list a values each time. In other words can I add new values each time and they will be stored inside the local storage. for example I need to save a new location with different name. unfortunately the previous information get overridden.

---

<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 28, 2021, 9:43pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/2 "2021-04-28T21:43:14Z")

</div>

Yes you can. It should be the Local Storage not Local DB.

Show your block to see why you have this overwriting issue.

---

<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 28, 2021, 9:44pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/3 "2021-04-28T21:44:03Z")

</div>

Hi  
i dont know if i understand you right

but check this if will work for you  
[https://x.thunkable.com/copy/6eb175ce2d517a9e2d7df747794a869c](https://x.thunkable.com/copy/6eb175ce2d517a9e2d7df747794a869c)

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 6:39am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/4 "2021-04-29T06:39:48Z")

</div>

Fist am adding the text box to a sub-list called locList, then am adding that sub-list into the main List called listMain. and finally am saving the main list into the Local storage

my block to add new entries is:

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

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 6:42am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/5 "2021-04-29T06:42:33Z")

</div>

Then am using the following code to display the contents of the localstorgage

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/475097066b358a7b8f9f7b87135a60903f5929ab.png)

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [April 29, 2021, 6:47am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/6 "2021-04-29T06:47:00Z")

</div>

Hi there,

You might find this easier if you use [stored variables](https://docs.thunkable.com/variables#stored-variables) in your app.

You could also save all of these details as properties of an [Object](https://docs.thunkable.com/objects), and have a list of Objects in your app.

It also looks like your Get blocks retrieve a single item of the list at a time (for each item `j` in list…) but then treat this item `j` as a list. What are you hoping to do here? What do you see when these blocks execute?

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 6:47am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/7 "2021-04-29T06:47:53Z")

</div>

Please bader\_mouti. in your code you used

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

User-Id OR Username as a key, is that means there will be two keys?, what if I have five inputs like:  
1-User Name  
2-Address  
3- Mobile  
4- Job  
5- Salary

in that case should i use:  
User-Name OR Address OR Mobile OR job OR Salary

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 6:53am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/8 "2021-04-29T06:53:01Z")

</div>

Hi Jane, please clarify, something to me, my understand is that if we use localstorage, the information will stay on my Mobile and I can’t share it, they only for displaying certain information about my system, and mostly used for setting purposed. That means to my understand both Locatstorage and stored variable have the same function, storing data mostly for settings, and private information.???

---

<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 29, 2021, 8:07am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/9 "2021-04-29T08:07:40Z")

</div>

No I just write User-ID OR User name  
To explain to you that you can use any of them as a key

If you have 5 inputs you need just 1 Key and all your inputs will be saved under that key

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [April 29, 2021, 8:15am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/10 "2021-04-29T08:15:48Z")

</div>

Or, you can use objects inside your stored variables.

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [April 29, 2021, 11:42am UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/11 "2021-04-29T11:42:29Z")

</div>

They do, but the stored variable blocks are easier to work with. (They can also be used to store other data types, including media, unlike the Local Storage component, but that’s not relevant here!)

For example, looking at your first screenshot, you could save `locListMain` as a stored variable, and then you can save it between app sessions and retrieve its data easily! No need for the Local Storage blocks at all, no extra blocks needed. You would simply be saving `locListMain` as a stored variable instead of an app variable.

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 6:13pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/12 "2021-04-29T18:13:46Z")

</div>

Thank you bader\_mouti. please how to store multiple values under one key.  
for example:  
The key is : location  
and under that key I have multiple locations:  
location  
—loc1  
—loc2  
—loc3  
—loc4  
and so on

---

<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 29, 2021, 6:55pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/13 "2021-04-29T18:55:52Z")

</div>

it will be like this  
and you can use any thing to save the value Text\_ input or …

 ![Screen Shot 2021-04-29 at 9.49.47 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/f/cf0179963e4453ed885d04c16dd2d62dc5c483be.png)

and when you want to get value its will be like this

![Screen Shot 2021-04-29 at 9.55.22 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/2/f225fd723cd91ba73063320609bc5523eb4815aa.png)

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 7:00pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/14 "2021-04-29T19:00:31Z")

</div>

Thank you for the reply  
my questions is it one time entry, which means next time I used the key “location”, the data stay or get over-written, In other words can i keep the previous data all together with the new entries

---

<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 29, 2021, 7:03pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/15 "2021-04-29T19:03:05Z")

</div>

If you can tell me what you’re trying to do, maybe I can help you better

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 7:06pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/16 "2021-04-29T19:06:47Z")

</div>

Thank you bader\_mouti  
what am trying to is that:  
I want to store different locations. for example in my city (which is the main key) I have different locations, with different names, address and even latitudes, and longitude address. I want to store them locally in my app

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 7:09pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/17 "2021-04-29T19:09:14Z")

</div>

I my city, which is called Salalah, I have different locations, I want to store these location under the name Salalah, but I have location 1, which may have different information like, name, address, latitude, longitude, and so on with location 2, and location 3…

---

<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 29, 2021, 7:17pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/18 "2021-04-29T19:17:12Z")

</div>

like this you will save different locations under your city name  
in the image below you can change ( location Number 1 )  
for ( location Number 2 ) and like this you will save 2 location withe details under your city name

 ![Screen Shot 2021-04-29 at 10.13.22 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/9/e985dbc04eebe5b1fc325db851b9a32612e44d9a.png)

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [April 29, 2021, 7:20pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/19 "2021-04-29T19:20:39Z")

</div>

Thank you, bader\_mouti…i will try it now, but please… how to retrieve the values, i think it will be a very complicated process, sorry to say that, am still a beginner in thunkable…

---

<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 29, 2021, 7:26pm UTC](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264/20 "2021-04-29T19:26:40Z")

</div>

no problem, it’s so easy  
but where you want retrieve the values  
in data Data\_Viewer\_List1 or in label or … ??

so i can make example for you

[Next page](https://community.thunkable.com/t/local-storage-can-i-used-to-store-multiple-values/1251264.md?page=2)
