# Validity of the lists

**URL:** <https://community.thunkable.com/t/validity-of-the-lists/385287>\
**Category:** Questions about Thunkable X\
**Created:** [December 29, 2019, 1:57pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287 "2019-12-29T13:57:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [December 29, 2019, 1:57pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/1 "2019-12-29T13:57:44Z")

</div>

Hello,  
I would like to know what is the validity of the variables lists; for example if I create a list inside a procedure … this has no validity inside another.

I initialize the variable with “empty list” and then call a procedure that fills the list and then again I would like to use it in another … ex. “Screen Open”.

Andrea

---

<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 29, 2019, 5:35pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/2 "2019-12-29T17:35:08Z")

</div>

Set up this way, you can use the list variable (myList) in other blocks and other screens as well:

![Screen Shot 2019-12-29 at 9.27.58 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/f/dfd19af84ae93cadf207bd4f20e439a4dc11f8d6.png)

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [December 29, 2019, 9:56pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/3 "2019-12-29T21:56:25Z")

</div>

Hello,  
I created my blocks in the same way as you can see but the lenght of my list when I printed is equal to zero.  
your right, if i replace the spreadsheet block with a static list as in your example works fine … maybe is my airtable blocks?  
Thanks  
Andrea

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b9566370a696a1cd6c58809cc67dead88172b82e.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:** [December 30, 2019, 1:59pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/4 "2019-12-30T13:59:50Z")

</div>

Hi @Andrea_Marchisio,

I can see that you set the View Name of your spreadsheet before retrieving any values in your **myList** function.  
Can you try setting the View Name of your spreadsheet in the Properties window of the spreadsheet components?

For actually compiling the list, your current blocks will create a single-item list that is the ‘Titulo’ property of the last row in your spreadsheet. I think what you’re trying to do is make a list of every ‘Titulo’ property in your list, correct?

You could do this more easily using the Spreadsheet’s ‘Get Column’ block, then setting ‘link\_articolo’ to the list you retrieve.

In general, the block you use to append a value to a list is ‘in list [LIST] insert at [POSITION] as [VALUE]’:

![listinsert](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/b/8b2add5dc7f71104ce65445e60f7f65d294c5df4.png)

---

<div class="post-metadata">

**Author:** ![Andrea\_Marchisio](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Andrea\_Marchisio](https://community.thunkable.com/u/Andrea_Marchisio)\
**Post date:** [December 30, 2019, 5:44pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/5 "2019-12-30T17:44:10Z")

</div>

Hello Jane,  
today I realized that the problem was due to timing: when you open a window and call a procedure … the “open” block does not wait for it to be finished but continues with the rest; that’s why I never saw the enhancement of my list.  
Just put a “Wait” block and now it’s ok.

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

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

Now just to complete my procedure … I have to insert the data but multidimensional … in a static way it’s simple as follow but with dinamic data no.  
What do you advice me?

Thanks  
Andrea

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/6/a6b925e6f4fe977dd6ac8b1f371680bf47263f00.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:** [December 30, 2019, 10:13pm UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/6 "2019-12-30T22:13:51Z")

</div>

Hi Andrea,

Regarding your **myList** function: I’m glad this works for you! I’ll just point out that, since you’re using a ‘set list’ block rather than a ‘append to list’ block, you don’t need to include the ‘count with x from…’ block. It just means that you’re calling the same ‘set list’ block multiple times.

These blocks will be fine as long as you will only ever have 2 rows in your spreadsheet. If you want your blocks to be more flexible and be able to call more/fewer values in the future, try one of the methods in my previous comment. I’d be happy to give advice on either one!

Regarding your multi-dimensional list, what you’ve done is exactly right. This will provide the list [[AAA,BBB,CCC],[DDD,EEE,FFF],[GGG,HHH,WWW]].

Jane

---

<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, 11:46am UTC](https://community.thunkable.com/t/validity-of-the-lists/385287/7 "2024-11-08T11:46:11Z")

</div>


