Zapier integration : Get row ID based on another field

Just successfully tested this.

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

image

Setup the inputs as I have below.

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

Now here’s the code:

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.

5 Likes