# \[Solved\] How can I store a list in Local\_Storage?

**URL:** <https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631>\
**Category:** Questions about Thunkable X\
**Created:** [August 19, 2019, 2:29am UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631 "2019-08-19T02:29:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [August 19, 2019, 2:29am UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/1 "2019-08-19T02:29:37Z")

</div>

Hello Thunkers! 🎉

* * *

I am making a Notes app.  
I want to store every note the user takes in a tiny db / **Local Storage**.  
Certainly, it would be stored as a **list**.

How can I do this?

I tried some blocks, but they aren’t working -

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

* * *

Any help would be appreciated 😄

### Thanks! 😉

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [August 19, 2019, 2:49am UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/2 "2019-08-19T02:49:34Z")

</div>

Each time you are storing, if you use the _same_ key, you are _overwriting_ what was there before.

If you want to append, you need to

- extract the record using the key
- add the new note (append to the list)
- store the updated list back using the same key

The downside is that you need to extract a larger and larger list each time you need to add to it.  
A more satisfactory approach would be to use new key each time.  
And to have an absolute counter.  
Basically, you have a record called “last” (key= “last”), which is initially set to 0.  
When you save the note, and assuming you want to use “meow” as key, then instead you use “meow\_1” because the value of “last” is 0. You increment “last” by 1, and save it using its key, then append the \_1 to the key and use THAT augmented key (“meow\_1”) to store the first record.

Next time something needs to be added, you do not need to recover all the previous notes (unless you need to display them) just to add a new one. You get “last” out, check its value (say it is “n”) , know that you therefore have “n” records, and that the next one needs to be save using key = “meow\_” + (n+1).

You have all the flexibility (if you need to recover all the past notes, you simply need to run the suffix of the index in a repeat loop to create all the keys) and adding new ones does not require you to get them all out each time, so you gain in performance.

---

<div class="post-metadata">

**Author:** ![Hayder](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hayder/32/153829_2.png) [@Hayder](https://community.thunkable.com/u/Hayder)\
**Post date:** [August 19, 2019, 6:06am UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/3 "2019-08-19T06:06:35Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/d/8d6c9ae691debc682a1362ed33831f1bda4bb09d.png)

---

<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:** [August 19, 2019, 12:04pm UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/4 "2019-08-19T12:04:09Z")

</div>

Hello,

check it.

![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/23a27782280bb167bd3239f948b842edb25835a8.png)

---

<div class="post-metadata">

**Author:** ![kartik\_old](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik_old/32/28305_2.png) [@kartik\_old](https://community.thunkable.com/u/kartik_old)\
**Post date:** [August 19, 2019, 2:17pm UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/5 "2019-08-19T14:17:24Z")

</div>

# It’s a great Solution! ✅

# Thanks a lot, @actech!

---

<div class="post-metadata">

**Author:** ![Hayder](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hayder/32/153829_2.png) [@Hayder](https://community.thunkable.com/u/Hayder)\
**Post date:** [August 19, 2019, 5:32pm UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/6 "2019-08-19T17:32:52Z")

</div>

It’s the same with local storage. But you asked about local storage. If you have a problem with list inside stored variable then use local storage.

---

<div class="post-metadata">

**Author:** ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)\
**Post date:** [October 10, 2020, 8:03pm UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/7 "2020-10-10T20:03:27Z")

</div>

hayder,

how to call from airtable? i want to call back all information that he saved to other screen.

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

---

<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:11pm UTC](https://community.thunkable.com/t/solved-how-can-i-store-a-list-in-local-storage/186631/8 "2024-11-08T12:11:49Z")

</div>


