Skip to main content

I’m trying to search a google sheet’s column for a value, and only if it the value is present, then continue with the Zap.

I’ve tried a bunch of the Google Sheet Action Events (namely: ‘Lookup Spreadsheet Row’) but am not getting the effect I need. Really struggling to see how to find out if a value is present in a column.

Thanks for any help with this! :)

HI @MGZ 

Do you mean you want to search the column header for a certain value?


Hi Andrew,

I have a column of country codes in column B of the google sheet. I wish to refer to this column and check if it contains a specific country code. If it does, then my Zap continues, if it doesn’t then the Zap stops.

So far I have all the parts of my Zap figured out, apart from this one step of checking this Google Sheet’s column for a county code. My reason for storing these country codes in a google sheet column is that I will be referencing this same google sheet column multiple times from multiple Zaps and so being able to edit the list of country codes in one place (the google sheet column) is a big advantage.

If it’s not possible to do this using Google sheets, perhaps there is an other method in Zapier to achieve the same effect?

Thanks for the help!


Try this Zap action step: GSheets - Lookup Row

 


Hi Troy,

I’ve tried that one, but when there is no match it outputs the error:

“Bargle. We had trouble getting a matching spreadsheet row. :-(Error details:
Nothing could be found for the search.”

I think this prevents the Zap from working, or is this error not an issue?

Thanks!


The Zap won’t continue to steps in the Zap that rely upon data from the GSheet Lookup Row step if NO result is returned from the GSheet, and that will produce an error in the Zap Task History: https://zapier.com/app/history/

 

To fail gracefully and avoid errors in the Zap Task History, you could add a Filter step after the GSheet Lookup Row step: https://zapier.com/apps/filter/help


Thanks for the help Troy. I can’t seem to see how the filter step would help though.

Perhaps I should store the list of Country codes on a different platform that is easier to reference from a Zap for a simple exists/doesn't-exist toggle for continuing?


Found a workaround in case others run in to the same issue…

Make the Google Sheet column of data a row instead and use “Get Many Spreadsheet Rows (Advanced, With Line Item Support)” to grab the whole data set to check against later on in the Zap as needed.


The Filter step would prevent the Zap from continuing if no result was returned from the GSheets Lookup Row step.

Filter logic would be: Country exists


Hi @MGZ!

To reiterate what Troy has said, when you add a filter and look for a field to exist in a search step, then you can control whether the Zap continues on to later steps.

I am curious, though, about the workaround you mentioned. Would you be able to elaborate a bit or show a screenshot of how you’ve got that set up. I’m not 100% clear on how this would be more effective than having it in a column.