# Store items in a list

**URL:** <https://community.thunkable.com/t/store-items-in-a-list/2584147>\
**Category:** Questions about Thunkable X\
**Created:** [September 8, 2023, 5:14am UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147 "2023-09-08T05:14:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [September 8, 2023, 5:14am UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/1 "2023-09-08T05:14:34Z")

</div>

Best practice question of lists.  
i want to create items to a list. The list should be consistant in new sessions (when i reopen the app “tomorrow” )  
How do i do that? The app variable disappears over each session as it seems and is probably correct.  
However, using “Store” is not good as i cannot tell the variable to be a list (Make a list block cannot be attached.  
Cloud is not an option as it loses connection with both airtable, google sheets and the “own created table” So, can you give example of adding items to a list which is then stored i the app over sessions.  
Thanks

@tatiang Perhaps you are the 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:** [September 8, 2023, 6:27am UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/2 "2023-09-08T06:27:55Z")

</div>

_App_ variables do not save values once the app is closed. You could use a _cloud_ variable to store a list because Firebase data is cloud-based and therefore available even after an app is closed. But generally a _stored_ variable is the best option for this.

Here’s a project that demonstrates this: [Thunkable](https://x.thunkable.com/copy/0ac7bc267ba97ae76cc26e201c957737)

---

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [September 8, 2023, 10:05am UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/3 "2023-09-08T10:05:48Z")

</div>

I see what you mean thanks - One questions though  
IF i want to use Store (not Cloud)  
How shall i let the STORE variable understand there is a LIST to Store?  
I cant create as “make a list” can I?

---

<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:** [September 8, 2023, 4:09pm UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/4 "2023-09-08T16:09:15Z")

</div>

I know it’s confusing that you can’t initialize a stored variable with a variable _type_ (list, text, integer, etc.). But you can still **set** the value of a stored variable. The first time you set the value, it will also set the _type_. So if you assign a list block to a stored variable then that stored variable is a list variable.

These blocks force the stored variable myList to be a list variable and allow you to then use list blocks with that variable:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/07521dc05f9dd4a480c3f2657c2526cb5d2cd5b3.png)

It’s important to check for a null value when the screen opens because a stored variable will always be null the first time the app launches.

By the way, the `make list from text` block isn’t really needed here. I just wanted a quick way to pick a random word from a list so I used it. I rarely use that block when working with lists.

---

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [September 8, 2023, 9:24pm UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/5 "2023-09-08T21:24:49Z")

</div>

Again thanks for helping…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/5/f570357f0ab5177e4b4e76440aaffe9f253d68a4.png)  
This image show it works and the first item is added at last in list (Position 1)  
When do ytthe next registration - expected behavior would be to place next one in Position two as i use “At Last” in list…  
However number one keeps being overwritten  
Any idea on that one…  
(I did a check with how long is the list and it keeps stating “1”)

---

<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:** [September 8, 2023, 9:56pm UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/6 "2023-09-08T21:56:26Z")

</div>

I can’t tell why that would happen from the partial screenshot you posted. It depends on the event you’re using (when screen opens, when button click, etc.) and on other blocks that might be there but aren’t visible.

I can tell you that the check for = null with a stored variable is only needed and will only be true when the app opens for the very first time. That’s where I set the initial value (e.g. empty list) for the variable. After that, it won’t ever happen again.

But to your question, yes, if you insert an item at “last” in a list and then insert it at “last” again in the same list, those values should follow each other as they do in the demo I provided with the first value inserted followed by the second value.

---

<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:** [December 7, 2023, 9:56pm UTC](https://community.thunkable.com/t/store-items-in-a-list/2584147/7 "2023-12-07T21:56:41Z")

</div>

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