# Find Item in List

**URL:** <https://community.thunkable.com/t/find-item-in-list/636517>\
**Category:** Questions about Thunkable X\
**Created:** [June 21, 2020, 5:47pm UTC](https://community.thunkable.com/t/find-item-in-list/636517 "2020-06-21T17:47:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesshepherd876pnr](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jamesshepherd876pnr](https://community.thunkable.com/u/jamesshepherd876pnr)\
**Post date:** [June 21, 2020, 5:47pm UTC](https://community.thunkable.com/t/find-item-in-list/636517/1 "2020-06-21T17:47:17Z")

</div>

Hi All,

I can’t quite work out if this thread is about the same problem i am finding.  
Basically i am trying to add items to an empty list and then return the index of where that item is positioned. I used these blocks but the label i was hoping to display the position of ‘T’ comes out as 0. Which i understand means not found.

Second set of blocks shows how I previously had success with this in MIT app inventor. I’m new to thunkable and wondering if ive used the wrong blocks.

 ![Screenshot 2020-06-21 at 18.43.19](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/a/5a28c7e01d9cb30959387cd98a161991571ade53.png) ![Screenshot 2020-06-21 at 18.43.43](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/b/eb13471e38c767a74c3eb06b9584698b762bf441.png)

Appreciate any help  
Thanks,  
James

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [June 25, 2020, 12:50pm UTC](https://community.thunkable.com/t/find-item-in-list/636517/2 "2020-06-25T12:50:30Z")

</div>

Hey @jamesshepherd876pnr 👋

Don’t think this is related to the previous topic so I’ve moved it here to make it easier to find.

Here’s a quick summary of what’s happening, and the solution is at the end.

I’m guessing this is how the error happened. You had these blocks:

 ![find_in_list](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/5/a5c0ae1ef5df4422eb36bc4984eaa2fb30c545c4.png)

The `find in list` block creates its own local list to search through. We can consider this to be:

`list(a,b)`

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

* * *

You’ve also created your own global list, lets call it:

`myList()`

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

* * *

So, when you click on the button you pass your global list into the local list. Essentially:

`list(myList(T)) `

So your list is actually inside of another list.

 ![list_in_list](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/c/4cf651e49746671722a5aded85b72b34cfe89120.png)

* * *

To get this working, all you need to do is pass `myList()` as the input for the list parameter, like this:

 ![resolved](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/4/b444f2d1974aebe974b3736413a10f6f21dd51ee.png)

---

<div class="post-metadata">

**Author:** ![jamesshepherd876pnr](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jamesshepherd876pnr](https://community.thunkable.com/u/jamesshepherd876pnr)\
**Post date:** [June 27, 2020, 7:24pm UTC](https://community.thunkable.com/t/find-item-in-list/636517/3 "2020-06-27T19:24:08Z")

</div>

@domhnallohanlon  
This is great thanks so much! Saved me a lot of brain ache.

For anyone else looking and trying to do the same. I had a bit of trouble getting this block into the same format you mentioned (probably a rookie mistake)  
But I was looking at this and thinking it was the same as yours:

 ![Screenshot 2020-06-27 at 20.14.17](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/158db136b9a74a1802c2a683421274a7930c2c4e.png)

I realised I had to remove all ‘items’ from the list, otherwise like you mentioned I’m putting a list in a list:

 ![Screenshot 2020-06-27 at 20.14.36](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/c/ec58469e2c5221585a66844a38744f54036980f2.png)

And then it came up as empty list:

 ![Screenshot 2020-06-27 at 20.14.50](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/8/38d630694801a7d6af69015639300ead86cd9cc6.png)

And then add the list variable

 ![Screenshot 2020-06-27 at 20.18.51](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/f/1fb8c351d3ff6a9a5fd1e28f59d1ff9f78ac3aef.png)

Might have just taught anyone watching to suck eggs but in case a newbie like me was out there scratching their head well there you are!

---

<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:25am UTC](https://community.thunkable.com/t/find-item-in-list/636517/4 "2024-11-08T11:25:27Z")

</div>


