# \[Solved\] How do I get row number from Airtable?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [March 23, 2020, 12:18am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422 "2020-03-23T00:18:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![qaburns014w](https://avatars.discourse-cdn.com/v4/letter/q/58956e/32.png) [@qaburns014w](https://community.thunkable.com/u/qaburns014w)\
**Post date:** [March 23, 2020, 12:18am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/1 "2020-03-23T00:18:01Z")

</div>

My app allows users to view or sell items for reuse. In the home screen, all the rows from Airtable are displayed in a ListViewer showing the title of the posts. I’m working on a search function where the user inputs a string and filter through all the rows to only display rows with that title in a ListViewer. It works fine, but when the user clicks on a title to open up the next screen with the post details, I was passing the index of the listViewer but what I need to do is pass the row id that matches that post. I’m not sure how to do that, can you look at my code?

 ![Screen Shot 2020-03-22 at 6.03.07 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/b/1b8cfe991954a14a6d345c83e5e54f3bffda64f1.png)

Thanks,  
Quinn

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [March 23, 2020, 3:10am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/2 "2020-03-23T03:10:28Z")

</div>

Hi, @qaburns014w! 👋

When you apply any filter, the list-viewer shows only the supported items - ex. 20 from a list of 100.  
If you click on any of those, index will range from 1 - 20 & not the item’s native index. So, we need to keep track of the native indexes.

> Native index = row no. of the item.

To do so, we will make the _normal list_ a _numbered list_ by attaching the item’s native index in start of it. And then, when any item is clicked (doesn’t matter if the list is filtered or not), the item’s native index would be it’s starting no. (we’ll crop it).

First try this idea yourself, and then reply with the result here 👍  
Thanks! 😊

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 23, 2020, 3:11am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/3 "2020-03-23T03:11:51Z")

</div>

i assume your rowId is a column in your table. then a block like below can obtain the value of that column:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/1/116993343a5927eff09a0b9acc1f2a130ed12362.png)

however if, by rowId, you mean the unique row number assigned by airtable (during table creation), then Kartik’s trick (very clever) will work like magic!

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 23, 2020, 3:58am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/4 "2020-03-23T03:58:32Z")

</div>

@manyone can you produce a working example with our blocks?

I thought that rowNum only took an integer value. What you return could be anything. The issue with that being, there could be double of that anything. Because a list may have items from multiple data sources all in one, I’m wondering if this code works.

I didn’t think that when you add an item into a list, that it also carried over the row or item from whence it came

@kartik14’s suggestion is good. @qaburns014w, there are various ways of doing this. Another efficient/effective way to do this will be to use an auto incrementing number. or row \_key

when you pull data from your table, put the items from column ‘\_key’ into 1 list. put the items from your desired column in another. When you click on an item, the index will correspond with the key from the same row in the \_key list you just made.

Now, get column key without filtering, and save to alist. now, in this liist, find the first occurence of the \_key from the step above. these blocks would be your row number.

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [March 23, 2020, 4:53am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/5 "2020-03-23T04:53:34Z")

</div>

> [@jared](#):
>
> Now, get column key without filtering, and save to alist. now, in this liist, find the first occurence of the \_key from the step above. these blocks would be your row number.

What if the list have duplicate items and the user wants the second one?

Thanks! 😊

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 23, 2020, 5:12am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/6 "2020-03-23T05:12:53Z")

</div>

because if column key is always being incremented, it never duplicates. therefore it may look like this

row, key, animal, date born, name  
1, 23, cat, 3/14/15, jon  
2, 24, dog, 3/15/17, jake  
3, 33, cat, 3/15/17, jon  
4, 35, horse, 3/18/17, noName

assume this is a subset of a larger set of data  
key list: 1: 23, 2: 24, 3: 33, 4: 35  
name list: 1: Jon, 2: jake, 3: Jon, 4: noName

this way, if you click on the first Jon, you would only get info from that row. then, if you look up the corresponding key to the name, you would get the row number

```
On screen load
get column "Keys"
        set var.AllPossibleKeys = [green data event block]

when user click.ListItem
        set var.KeyToMatch = in list 'key list' get # [index from listviewer event block]

        set var.RowNum = in list [var.AllPossibleKeys] find first occurrence of [var.KeytoMatch]

```

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [March 23, 2020, 6:04am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/7 "2020-03-23T06:04:49Z")

</div>

i stand corrected.

the solution i offered works only for an UNFILTERED list view. it’s the typical way of obtaining any other column from the row that corresponds to item selected from the clicked list viewer.

but it wouldn’t work when the list viewer contains filtered rows.

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [March 23, 2020, 7:17am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/8 "2020-03-23T07:17:25Z")

</div>

Hi, @manyone! 👋

Did you try my idea? It should surely work for both **filtered** / **un-filtered** list. 👍

Thanks! 😊

---

<div class="post-metadata">

**Author:** ![qaburns014w](https://avatars.discourse-cdn.com/v4/letter/q/58956e/32.png) [@qaburns014w](https://community.thunkable.com/u/qaburns014w)\
**Post date:** [March 23, 2020, 10:31pm UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/9 "2020-03-23T22:31:37Z")

</div>

I understand what you are saying but I am not quite sure how to code it. Any chance you can look at my blocks above and help?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 24, 2020, 12:58am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/10 "2020-03-24T00:58:16Z")

</div>

> [@Airtable tutorial](http://community.thunkable.com/t/airtable-tutorial/531535):
>
> Working with airtable can be confusing. This sample app features: Filtering and viewing data Dynamically changing the filter Find a row number Pull specific info from a cell in a row Updating 1 cell inside a particular row Adding Rows Deleting Rows Remix Link: [https://x.thunkable.com/copy/15949b2e4aec44fe2eb7fd1a72c47414](https://x.thunkable.com/copy/15949b2e4aec44fe2eb7fd1a72c47414) [UPDATED LINK] Live Web App: [https://thunk.app/w/bbHuW-EAv](https://thunk.app/w/bbHuW-EAv) An explanation of how to build this app will be posted on my website sometime this week along with the w…

Please see this post @qaburns014w

---

<div class="post-metadata">

**Author:** ![qaburns014w](https://avatars.discourse-cdn.com/v4/letter/q/58956e/32.png) [@qaburns014w](https://community.thunkable.com/u/qaburns014w)\
**Post date:** [March 24, 2020, 9:29pm UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/11 "2020-03-24T21:29:44Z")

</div>

This worked! Thank you

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [March 25, 2020, 1:50am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/12 "2020-03-25T01:50:12Z")

</div>

Hi, @qaburns014w! 👋

Please mark @jared’s post as Solution ✅ since it solved your problem.

Thanks a lot!  
Happy Thunking! 🎉

---

<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:** [March 26, 2020, 3:23pm UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/13 "2020-03-26T15:23:25Z")

</div>

2 posts were split to a new topic: [How to Filter data from Airtable](https://community.thunkable.com/t/how-to-filter-data-from-airtable/537129)

---

<div class="post-metadata">

**Author:** ![Fernando\_Matos](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/fernando_matos/32/30641_2.png) [@Fernando\_Matos](https://community.thunkable.com/u/Fernando_Matos)\
**Post date:** [August 2, 2020, 1:45pm UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/14 "2020-08-02T13:45:48Z")

</div>

Hello works for you? Can you share the blocks, Thanks

---

<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:39am UTC](https://community.thunkable.com/t/solved-how-do-i-get-row-number-from-airtable/529422/15 "2024-11-08T11:39:38Z")

</div>


