# How to get ID an specific item from a Database created

**URL:** <https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682>\
**Category:** Questions about Thunkable X\
**Tags:** database\
**Created:** [February 12, 2023, 3:25am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682 "2023-02-12T03:25:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fr4xsfdhsr7a](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr4xsfdhsr7a](https://community.thunkable.com/u/fr4xsfdhsr7a)\
**Post date:** [February 12, 2023, 3:25am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/1 "2023-02-12T03:25:39Z")

</div>

Any one can help to me…

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

I want to to get the ID for the match of this sentence. If I put a value in the text user I obtain all the matches relation of this text user, and I can use the next columns for those match.

---

<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:** [February 12, 2023, 5:34am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/2 "2023-02-12T05:34:49Z")

</div>

It helps if you show us sample data.

If your database looks like this:

apple  
orange  
apple  
apple  
lemon

And you check if the list of values contains “apple” that will be true but it won’t give you **all** of the matches. For that, you need to use a loop.

Also, the `does contain` block only returns true or false. It will probably work better to loop through the values in that column and check each one, one by one, against the text input value.

You might find it helpful to Google _find all matches Thunkable_ because there are other examples of this.

---

<div class="post-metadata">

**Author:** ![fr4xsfdhsr7a](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr4xsfdhsr7a](https://community.thunkable.com/u/fr4xsfdhsr7a)\
**Post date:** [February 13, 2023, 12:52am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/3 "2023-02-13T00:52:04Z")

</div>

> [@tatiang](#):
>
> _find all matches Thunkable_

I’m trying but it backs to me whole “Lote” items, and I need just the items who already have it this user.

 ![1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/d/edd5118ef6eb989d94cb8e8208877bf04ed6fcfc.png)  
 ![2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/d/ed11134e88f651012d509c70e2be7885266173a0.png)  
 ![3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/0/107b205e88861c486d7eb97c4de5ff05fdfa27a3.png)

---

<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:** [February 13, 2023, 4:55am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/4 "2023-02-13T04:55:18Z")

</div>

Is this a Google Sheet? Because if it’s AirTable, there’s a better way to do this using their API and _filterByFormula_.

But if it’s not Airtable, then your method should work with a few changes. For one thing, you don’t need the [gear list] block in front of the [app variable entireList] block. The variable is _already_ a list. You almost never need to use the [gear list] block in Thunkable.

Also, the [list of values] block is slow because it gets every value. So don’t use it twice. And you shouldn’t update a List Viewer’s text items inside of a loop because you only need to do that _at the end_ of the loop.

Try this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/0/805610809c06af220e8037d7a01441bf930cf3e3.png)

Sometimes these loops are a little too fast. So if that doesn’t work for you, try adding a Wait 0 seconds block after the [if] block but inside the [count with] loop.

---

<div class="post-metadata">

**Author:** ![fr4xsfdhsr7a](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr4xsfdhsr7a](https://community.thunkable.com/u/fr4xsfdhsr7a)\
**Post date:** [February 14, 2023, 3:01am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/5 "2023-02-14T03:01:12Z")

</div>

It works but sometimes dont refresh the last registers.

With a Data Viewer list it could be posible too? I mean, that only show the items for the user input in textuser3 ?

---

<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:** [February 14, 2023, 4:45am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/6 "2023-02-14T04:45:17Z")

</div>

No, do not use a Data Viewer List.

You need to try adding a wait block, like I said above.

---

<div class="post-metadata">

**Author:** ![fr4xsfdhsr7a](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@fr4xsfdhsr7a](https://community.thunkable.com/u/fr4xsfdhsr7a)\
**Post date:** [February 14, 2023, 11:57pm UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/7 "2023-02-14T23:57:55Z")

</div>

Yes I do and it works like I said, but for example when I want to see if some specific user is in the list and if is not send an error, like number 1 is inside in other users it takes this and dont show the error alert. I mean for example I have user 1471 but I put number 1 in the text, this doesnt send the error alert.

---

<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:** [February 15, 2023, 1:15am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/8 "2023-02-15T01:15:46Z")

</div>

If you have user 1471 and you search for “1” then it will find that user.

I’m not sure I understand what you are saying.

---

<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:** [May 16, 2023, 1:16am UTC](https://community.thunkable.com/t/how-to-get-id-an-specific-item-from-a-database-created/2272682/9 "2023-05-16T01:16:44Z")

</div>

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