# Stored list variable

**URL:** <https://community.thunkable.com/t/stored-list-variable/2743094>\
**Category:** Questions about Thunkable X\
**Created:** [December 8, 2023, 8:48am UTC](https://community.thunkable.com/t/stored-list-variable/2743094 "2023-12-08T08:48:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![minamaestro2023kg](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@minamaestro2023kg](https://community.thunkable.com/u/minamaestro2023kg)\
**Post date:** [December 8, 2023, 8:48am UTC](https://community.thunkable.com/t/stored-list-variable/2743094/1 "2023-12-08T08:48:47Z")

</div>

I’d like to store a list variable so I came with following blocks , but it seems not working.

 ![Screenshot 2023-12-08 104655](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/5/7507216f6f0a741e65662b59e1c731f8eedbb62f.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:** [December 8, 2023, 3:42pm UTC](https://community.thunkable.com/t/stored-list-variable/2743094/2 "2023-12-08T15:42:31Z")

</div>

Can you post a link to your project? It’s hard to troubleshoot this without seeing more of your blocks.

---

<div class="post-metadata">

**Author:** ![minamaestro2023kg](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@minamaestro2023kg](https://community.thunkable.com/u/minamaestro2023kg)\
**Post date:** [December 15, 2023, 1:07pm UTC](https://community.thunkable.com/t/stored-list-variable/2743094/3 "2023-12-15T13:07:14Z")

</div>

@tatiang  
Here is the link  
[https://x.thunkable.com/copy/2d629c5b500cf8c53d106463a18ee387](https://x.thunkable.com/copy/2d629c5b500cf8c53d106463a18ee387)  
you will find What I want in screen 2  
there a text input and when I press the a button it should add item to simple list items, In addition, there is a block to store the list as a stored Variable so when the app reopen the list will retain its items,

 ![Screenshot 2023-12-15 150717](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/f/6f6ebffecf74f64d2fa2ba2ebca5eb93773e03f5.png)  
, but it’s not working.

---

<div class="post-metadata">

**Author:** ![tthompson41231](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tthompson41231/32/161401_2.png) [@tthompson41231](https://community.thunkable.com/u/tthompson41231)\
**Post date:** [December 15, 2023, 4:37pm UTC](https://community.thunkable.com/t/stored-list-variable/2743094/4 "2023-12-15T16:37:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![minamaestro2023kg](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@minamaestro2023kg](https://community.thunkable.com/u/minamaestro2023kg)\
**Post date:** [December 16, 2023, 8:21am UTC](https://community.thunkable.com/t/stored-list-variable/2743094/5 "2023-12-16T08:21:14Z")

</div>

that is great, you used just 1 variable,  
But what is the role of those 2 blocks

 ![Screenshot 2023-12-16 102137](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67cce99c2fd0792e9a4eae04f5446188df08269e.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [December 16, 2023, 1:38pm UTC](https://community.thunkable.com/t/stored-list-variable/2743094/6 "2023-12-16T13:38:34Z")

</div>

A stored variable should usually be given a default value if you ever need to check it value before you set its value or potentially reference it for other logic before you set it. That’s absolutely problematic as there’s not great error handling for that kind of thing.

So, on app start initialize your stored variables and then give it a default value if it’s initially null unless that’s what you need it to be set to.

---

<div class="post-metadata">

**Author:** ![minamaestro2023kg](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@minamaestro2023kg](https://community.thunkable.com/u/minamaestro2023kg)\
**Post date:** [December 16, 2023, 6:41pm UTC](https://community.thunkable.com/t/stored-list-variable/2743094/7 "2023-12-16T18:41:44Z")

</div>

Ok , Thank you Jared

---

<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:** [March 15, 2024, 6:42pm UTC](https://community.thunkable.com/t/stored-list-variable/2743094/8 "2024-03-15T18:42:41Z")

</div>

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