# Item in list but the function do not find it

**URL:** <https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303>\
**Category:** Questions about Thunkable X\
**Tags:** list, for-each\
**Created:** [October 6, 2022, 3:23am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303 "2022-10-06T03:23:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex\_ezacae](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@alex\_ezacae](https://community.thunkable.com/u/alex_ezacae)\
**Post date:** [October 6, 2022, 3:23am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/1 "2022-10-06T03:23:34Z")

</div>

hello all,

I am doing an app that is doing scan of EAN and I have a strange behavior on list.

 ![Capture d’écran 2022-10-06 à 05.21.08](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/a/fa8773b33b852343821aea5365782c6e366fb4f2.png)

the text2 gives me 1 but the text3 gives me 0  
do you have any ideas ? maybe I am too tired to see something obvious ☹  
thanks for your help.

---

<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:** [October 6, 2022, 3:30am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/2 "2022-10-06T03:30:33Z")

</div>

No, that doesn’t make much sense. Are you setting the counter variable to zero before each loop starts? You should do that each time you call the barcode scanner.

---

<div class="post-metadata">

**Author:** ![alex\_ezacae](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@alex\_ezacae](https://community.thunkable.com/u/alex_ezacae)\
**Post date:** [October 6, 2022, 6:23am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/3 "2022-10-06T06:23:39Z")

</div>

yes I am doing it.  
I just wonder if it is not a problem of size list. the list is 2442 items.

---

<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:** [October 6, 2022, 6:56am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/4 "2022-10-06T06:56:27Z")

</div>

Add another counter variable with a different name. Change it by 1 each time the loop runs (so put the `change` block below the inner `if` block). Display that new counter variable in a label. Then you can see if it’s getting through all 2442 items.

---

<div class="post-metadata">

**Author:** ![alex\_ezacae](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@alex\_ezacae](https://community.thunkable.com/u/alex_ezacae)\
**Post date:** [October 6, 2022, 7:02am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/5 "2022-10-06T07:02:19Z")

</div>

with the for each loop it is sure I am going through all items of the list  
I just made some tests with the component get an item in a list based on the index and there is no issue.  
the thing that I do not understand is why the component in list find do not find the item ☹

---

<div class="post-metadata">

**Author:** ![alex\_ezacae](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@alex\_ezacae](https://community.thunkable.com/u/alex_ezacae)\
**Post date:** [October 6, 2022, 7:13am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/6 "2022-10-06T07:13:47Z")

</div>

found it 🥳  
the value for the scan is not a number but a string.  
I forced it to a number and it is working

---

<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:** [January 4, 2023, 7:14am UTC](https://community.thunkable.com/t/item-in-list-but-the-function-do-not-find-it/2071303/7 "2023-01-04T07:14:02Z")

</div>

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