# \[Solved\] Looking up RowID using another Cell

**URL:** <https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [June 30, 2022, 12:27pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160 "2022-06-30T12:27:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![benrequireit](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/benrequireit/32/135576_2.png) [@benrequireit](https://community.thunkable.com/u/benrequireit)\
**Post date:** [June 30, 2022, 12:27pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/1 "2022-06-30T12:27:19Z")

</div>

Hi all,

First off, total newbie. First app, no prior coding experience, learning it all as I go, so some of this may be messier than it needs to be. I can’t see a similar topic, and any that are seem to have blocks and functions I can’t get hold of… Any and all help is appreciated!

**PROBLEM:**  
I need to delete a row in the Data Viewer List, based on the result of a number picked up in a barcode scan.

**THE PROCESS**  
QR Code scanned and delimited, creates 2 lists. One for stock codes, one for locations  
Function to join the two lists with a delimiter into one list  
Function should also add an app index (Followed some prompts on another post, but can’t be certain if this works)  
Data Viewer List takes the new combined list and makes 2 columns (using get substring); one for location, one for stock code.  
Barcode is scanned, text is updated on screen to show the last barcode scanned, and this is used as search string too.

**WHAT I WANT TO DO NEXT**  
Scanned barcode is searched. If match remove the row, if not show error.

**WHERE I’M STRUGGLING:**  
I can search the scanned code in both the separate code list, and the combined list and have a confirmation it’s there. I can see there’s a function to delete row based on rowID. I can’t find a way to… Well if it was excel it’d be an HLOOKUP. I realise this is not proper coding but essentially:  
FOR EVERY (J) IN (Combined list)  
IF (Scanned Code) = (Code in the list) THEN (give me the row ID)  
So I can then  
DELETE ROW (Using Row ID)  
Refresh

I know there were blocks that had get row options, but they don’t seem to be there anymore. I’ve looked in drag and drop and the old interface just in case. All the help articles I can find seem to use them too.

**CAVEATS:**  
I’d like to do this with the localDB over Airtable or gSheets because I can’t guarantee a data connection all the time, and there may be multiple users.  
I need to use Data Viewer List because I need the ability to swipe and assign exceptions.

* * *

I’m assuming I’ve way overcomplicated this and can provide whatever screenshots you need, I just can’t post many on my first day so didn’t want to use them up.

Thank you!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 30, 2022, 1:15pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/2 "2022-06-30T13:15:53Z")

</div>

Welcome to Thunkable

What you actually need is the following:

- Declare a list as variable.

- Use the `list of values in "table name" ....` to fill in the list.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/8/e88c00a019831ed0d3f01c50e32ca4042512f447.png)

- Search the list using `in list "list name" find first` and store the result.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/162e874bc3d2405fd5ee22a9781de57f59dced06.png)

- Use the result, as it is the index number in the list which corresponds to the row number in the table.

- With the result, use `delete row in "table name"`  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/f/4ff177b8a169df4293548bb5b200475b30037bdb.png)

This should do the trick.

---

<div class="post-metadata">

**Author:** ![benrequireit](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/benrequireit/32/135576_2.png) [@benrequireit](https://community.thunkable.com/u/benrequireit)\
**Post date:** [June 30, 2022, 2:38pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/3 "2022-06-30T14:38:13Z")

</div>

Hello Muneer,

Thanks for replying so fast. You’ve been a saviour on so many other threads so I hope you can help me too!

I’m afraid I do need a little clarification, and I can put screenshots in now.

 ![Screenshot 2022-06-30 152823](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/8/98b4400a27709db1cec4f499be90769b9954e5d9.jpeg)  
This is the way the lists get built and organised, including your suggestion at the bottom (The variables are initialised at the beginning)

 ![Screenshot 2022-06-30 153454](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/9/594c795a83515675fc0fc527eadf3753f9bb76e1.jpeg)  
This is how I interpreted your instructions but it’s deleting the last thing on the list regardless so I’ve definitely made a mistake!

Where am I going wrong, if you don’t mind?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 30, 2022, 4:55pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/4 "2022-06-30T16:55:12Z")

</div>

It’s easier for me to show you what I mean by a demo project  
[https://x.thunkable.com/projectPage/62bdcfa3fdabc0001115409b](https://x.thunkable.com/projectPage/62bdcfa3fdabc0001115409b)

In this project, I read the data from the table when the screen opens and store the values in two different lists.

The list of letters is displayed in a `List Viewer` for the user to select from, once selected the corresponding `radio word` is shown.

I had the row ID from the `List Viewer` directly and by using the `List blocks` to get the row ID. The same for the radio word, one directly by the `List Viewer index` and another by the computed row ID from the `List blocks`.

Hope this makes it clear.

Looking at you code, I can see that you are rebuilding the list of **LST-StockCodes** with every iteration of the loop when you only wants to do it one time once the loop is over.

Due to the fact that you are not showing the complete code, I don’t have any idea where, for example SO-Sorted, comes from among other things and therefore cannot comment.

As a suggestion, **Deletion** is a destructive process and I would leave it to the end. First I would use some labels to show that I am getting the correct (intended) row ID and once I’m satisfied, I will remove extra labels used for the debug process and implement the **Delete** block.

---

<div class="post-metadata">

**Author:** ![benrequireit](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/benrequireit/32/135576_2.png) [@benrequireit](https://community.thunkable.com/u/benrequireit)\
**Post date:** [June 30, 2022, 7:58pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/5 "2022-06-30T19:58:52Z")

</div>

Thanks so much for getting back to me.

I didn’t know what would and wouldn’t be relevant. I’ve made the project public and you can see everything you’d like: [Thunkable](https://x.thunkable.com/projectPage/6238522b26ed8400125e8647)  
I’m also putting comments on each section to clarify their purpose.

I see the proof of concept but I see you’ve used a List Viewer, not a Data Viewer which does seem to show the index as a usable item straight away. I need to use a Data Viewer as items might need to be swiped to mark if they were missing or substituted etc.

Also though, this is based on a list item being tapped, whereas I’d like this to start after an item is scanned, so the app needs to look through the list itself.

The idea for the app is it’s going to be used for multiple times a day for order processing (hence deleting both the rows as each item is scanned, and clearing all lists and viewers when the order has been marked as completed) so the clean sweep for deleting is involved, but I agree in the debug stage it should just show what it’s editing. Maybe I can replace this with update value to confirmed or something?

Sorry if your examples do what I need and I’m not understanding, this is all very new to me.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [June 30, 2022, 8:04pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/6 "2022-06-30T20:04:16Z")

</div>

> [@benrequireit](#):
>
> you’ve used a List Viewer, not a Data Viewer

They work the same. A `List Viewer` has a green block `Index` while a `Data Viewer List` has a green block `rowID`.

You can use the rowID of the `Data Viewer List` to refer to the rowID for the `delete block`.

If you feel more comfortable with a `Data Viewer List`, I’ll modify the project to use it.

**[Edit]**

You can remix the project. I have modified it to use a `Data Viewer List`.

---

<div class="post-metadata">

**Author:** ![benrequireit](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/benrequireit/32/135576_2.png) [@benrequireit](https://community.thunkable.com/u/benrequireit)\
**Post date:** [July 1, 2022, 9:46am UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/7 "2022-07-01T09:46:49Z")

</div>

I can now safely say I am one of hundreds you’ve helped on here!

I had to look at it laterally, and get the Row ID based on a scan rather than a touch but once I’d seen and taken apart how your example worked it made sense. I can’t thank you enough for your help!

Marked as resolved, and you have another person in your fan club 🙂

Thanks again!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [July 1, 2022, 12:01pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/8 "2022-07-01T12:01:34Z")

</div>

That’s good to know and thank you for the nice words.

---

<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:** [September 29, 2022, 12:01pm UTC](https://community.thunkable.com/t/solved-looking-up-rowid-using-another-cell/1947160/9 "2022-09-29T12:01:53Z")

</div>

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