Best answer

How to set a fallback for an Airtable lookup


Userlevel 1

Hi there - 

I setup a Lookup table in Airtable that I use to map a “city” value that I receive from Clearbit to a  “region” value that we use internally.

 

It works great - unless - the city isn’t in my Airtable. The Zap stops and I am sad. Ideally, the Zap would just continue… it’s ok if the field doesn’t resolve to anything, I’m ok with it being blank. 

 

Is there a way to set a ‘fallback’ so if it can’t find a record, the Zap just proceeds?

 

Thanks!

icon

Best answer by andywingrave 3 May 2020, 16:58

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +7

Hey @crovinelli ,

 

If I understand correctly, you want some sort of “default value” for this “city” you lookup. There are probably more ways you could do this, but my first thought was a small code action. You could:

  • Create a “code by zapier” action
  • Input the “city” data you retrieved earlier
  • make an IF, ELSE statement in the code
  • Output some “default” data if the “city” input is empty
  • Happily continue your Zap workflow

Hope this helps you. Let me know if you need any extra assistance.

 

~Bjorn

Userlevel 7
Badge +9

Hey there - I’m really not sure that this needs a code step. Can you not just use this option?

 

Userlevel 7
Badge +7

@Saastronomical Good idea, this however completely depends on what kind of values he is searching for and what kind of data is in the Airtable.

If he is searching from something else than the city, then it will still find the record but just not the city. @crovinelli If you are just having a table with City - Region than this would be the most simple way indeed!

Userlevel 7
Badge +9

you can just use a search query. I don’t see a use case for the API here unless I’m missing something

Userlevel 1

@Saastronomical for the win! 

Great tip. In addition to allowing the Zap to continue, checking that box allows me to:

  1. Pass on a value of “Other” into our customized ‘city’ field
  2. I can use the created rows in Airtable to tune my mapping in the future. (e.g. - I can see all cities where we don’t have matches…if we get enough of them I’ll add them to the lookup table).

Thanks for the suggestion!

-casey