# List index problem (list Get)

**URL:** <https://community.thunkable.com/t/list-index-problem-list-get/72214>\
**Category:** Questions about Thunkable X\
**Tags:** listview, list\
**Created:** [March 13, 2019, 7:04pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214 "2019-03-13T19:04:55Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boccio](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Boccio](https://community.thunkable.com/u/Boccio)\
**Post date:** [March 13, 2019, 7:04pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/1 "2019-03-13T19:04:55Z")

</div>

Hi all,

in my code i use a textinput to fill a list (of 8 elements) then i use “shuffle” on the list and i split it in two separate lists of 4 elements each.

if i use a listviewer on my shuffled list it display correcly all 8 elements but in my other 2 lists it seems like I lost the first number so the second element is shown as first and the 8th is missing

(_mescolato_ is my shuffled list, and i’ve used List\_Viewer5 only to know if _mescolato_ was correctly shuffled)

 ![screen2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1c154b0f19bb8b6df30db82c642257e353c0ebe6.png)

what perplexes me is that this happens only sometimes, it almost seems that sometimes the list index starts with #1 and others with #0.

Any clue?

---

<div class="post-metadata">

**Author:** ![Cian\_O\_Sullivan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cian_o_sullivan/32/34494_2.png) [@Cian\_O\_Sullivan](https://community.thunkable.com/u/Cian_O_Sullivan)\
**Post date:** [March 13, 2019, 10:18pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/2 "2019-03-13T22:18:14Z")

</div>

Yepper,

When you open a screen you need to give it time to open. Create a process/function and nest those elements in the function.

---

<div class="post-metadata">

**Author:** ![Boccio](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Boccio](https://community.thunkable.com/u/Boccio)\
**Post date:** [March 13, 2019, 11:12pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/3 "2019-03-13T23:12:28Z")

</div>

hi, thanks for the help,

i’m pretty new so correct me if i’m wrong, i’ve to create a function where i split in two list and then call that function when i open the screen?

---

<div class="post-metadata">

**Author:** ![Cian\_O\_Sullivan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cian_o_sullivan/32/34494_2.png) [@Cian\_O\_Sullivan](https://community.thunkable.com/u/Cian_O_Sullivan)\
**Post date:** [March 13, 2019, 11:40pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/4 "2019-03-13T23:40:03Z")

</div>

Correct.

Pull stuff away from the immediate trigger on screen open. Let the screen open and settle. If you have a bunch of background stuff going on, it can slow the screen opening down and cause issues to skip, stall, or hit null\>void.

---

<div class="post-metadata">

**Author:** ![Boccio](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Boccio](https://community.thunkable.com/u/Boccio)\
**Post date:** [March 14, 2019, 12:14am UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/5 "2019-03-14T00:14:45Z")

</div>

Unfortunately it’s the same,  
i also tried to add a button that call my function so i can leave it some time to load, but the got the same result. ☹

---

<div class="post-metadata">

**Author:** ![Cian\_O\_Sullivan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cian_o_sullivan/32/34494_2.png) [@Cian\_O\_Sullivan](https://community.thunkable.com/u/Cian_O_Sullivan)\
**Post date:** [March 14, 2019, 12:25am UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/6 "2019-03-14T00:25:52Z")

</div>

and it works sometimes and other times it does not even with the button? (nice job with that. Great way to debug)

---

<div class="post-metadata">

**Author:** ![Boccio](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Boccio](https://community.thunkable.com/u/Boccio)\
**Post date:** [March 14, 2019, 1:24am UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/7 "2019-03-14T01:24:41Z")

</div>

yes, no changes, even with the button,  
in my opinion it’s a index issue, cause i’ve done another test:  
 ![asd](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/3/3351eeeaf9877cc3c989e8d410766b9a069b7696.png)  
i’ve removed the function and added a label where i will put the value of the #0 element in list.  
When the error occour the label change from “undefined” to “first element of list”, so it seems that sometimes lists starts at 0 😲

it’s this possible?🤔

---

<div class="post-metadata">

**Author:** ![Cian\_O\_Sullivan](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cian_o_sullivan/32/34494_2.png) [@Cian\_O\_Sullivan](https://community.thunkable.com/u/Cian_O_Sullivan)\
**Post date:** [March 14, 2019, 1:35am UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/8 "2019-03-14T01:35:59Z")

</div>

You still have it in the Screen Opens. Don’t include this complex logic in that block

---

<div class="post-metadata">

**Author:** ![suigeneris](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@suigeneris](https://community.thunkable.com/u/suigeneris)\
**Post date:** [March 14, 2019, 4:37pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/9 "2019-03-14T16:37:36Z")

</div>

> [@List index behavior](http://community.thunkable.com/t/list-index-behavior/53618/):
>
> Are lists indexed starting at 0 or at 1? I have blocks to get an index from a listviewer item clicked that lines up with a list of objects and I had to set the index to “index-1” from the listviewer to index the objects correctly, but eventually as I use the app that behavior changes and indexes the object one earlier than i want. Example: I click the second listviewer item and the blocks that set the variable “app idx” subtracts one from the listviewer index to make “app idx” 1, which indexes …

List indexes have been an issue for a while

---

<div class="post-metadata">

**Author:** ![Boccio](https://avatars.discourse-cdn.com/v4/letter/b/c89c15/32.png) [@Boccio](https://community.thunkable.com/u/Boccio)\
**Post date:** [March 14, 2019, 10:54pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/10 "2019-03-14T22:54:26Z")

</div>

So it’s probably a bug and not some errors of my code?

---

<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:16pm UTC](https://community.thunkable.com/t/list-index-problem-list-get/72214/11 "2024-11-08T12:16:04Z")

</div>


