# Zapier integration : Get row ID based on another field

**URL:** https://community.glideapps.com/t/zapier-integration-get-row-id-based-on-another-field/72995
**Category:** Ask for Help
**Tags:** api
**Created:** [May 1, 2024, 7:25pm UTC](https://community.glideapps.com/t/zapier-integration-get-row-id-based-on-another-field/72995 "2024-05-01T19:25:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [May 2, 2024, 1:24am UTC](https://community.glideapps.com/t/zapier-integration-get-row-id-based-on-another-field/72995/2 "2024-05-02T01:24:50Z")

</div>

Just successfully tested this.

Add a “Code by Zapier” step and choose Run Javascript.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/f/1fd028fa1edff9f31589a10d89728266bdcca6fc.png)

Setup the inputs as I have below.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/4/64be0ba8071ca7e1d9458f05c1ac88e033a8ba1c.png)

The “search” part will reference the email you want to find the rowID for.

Now here’s the code:

```auto
let emails = inputData.emails.split(",");
let rowIDs = inputData.rowIDs.split(",");

let index = emails.findIndex(email => email.includes(inputData.search));

output = {rowID: rowIDs[index]};

```

I split the emails and rowIDs into arrays, then find the index of the email that matches the search term, and return an index.

I finally return the output as the rowID that match the index I found above.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/a/4ac35fba2a167deba6a89ff7723d0b055e5c9635.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/7/e7edf3aaec60fc249ff0ef294dda39e14c10ab3d.png)

---

_[View the full topic](https://community.glideapps.com/t/zapier-integration-get-row-id-based-on-another-field/72995)._
