Hello. I usually use zapier + google sheet. I am now trying to work between zapier + glide tables.
I need to find a Row ID based on the Email of a user in the Users table of Glide.
With google sheet integration, I usually do a Lookup spreadsheet row with the email directly. But with Glide integration I can only look for a row only based on the Row ID.
Therefore, in Zapier, I do an action “Get all rows in Glide” so I get all rows, email and the other fields.
But how do I get the right Row ID corresponding to the user’s email I want?
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.
@ThinhDinh Something weird happens here.
It worked well but now I don’t understand why but the javascript doesn’t find the right rowID anymore :
In the report, the rowID is right in the GET ALL ROWS IN GLIDE :
However when running the javascript, the rowID is wrong :
Here is what the automation looks like. I need to find the rowID to edit it. :
@Jeff_Hager@ThinhDinh exact, that may be this. Many email addresses are duplicates and there may be some empty.
Is there anything I can add to the code to fix it ?
Maybe cleaning the index before.
The reason for asking if there are any empty emails is because the array may ignore those empty ones and shift everything in the email array up by one, so after that empty email, all other emails become mismatched with there corresponding RowID.
This is true, there should not be. I just have another zapier automation that added duplicates. I have cleant the duplicates and empties and it seems like you were right.
Thank you ! Hopefully I am good now.
At least now I know that the table must be clean.