Help

OR with possible blank

Solved
Jump to Solution
717 2
cancel
Showing results for 
Search instead for 
Did you mean: 
michaelkn
4 - Data Explorer
4 - Data Explorer

I've got a little script on Zapier where if somebody registers for a Zoom meeting, we add them to Airtable. To avoid duplicates, I search for to see if we already have a record for the registrant with a query like this:

OR({Email 1} = "{{email}}",{Email 2} = "{{email}}",{Email 3} = "{{email}}",{Phone 1} = "{{phone}}",{Phone 2} = "{{phone}}",{Phone 3} = "{{phone}}")

However, if Airtable doesn't find the email in any of the three email columns and the {{phone}} is blank, then Airtable will return a result for a record with a blank phone number, which is obviously not what we want here.

Is there any way to construct a query that will not return a match for an empty phone number?

Thanks!

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, is it that the result's "Phone 1" value is empty, and as a result it matches and thus returns it?  If so, perhaps you add an "AND" there so that it was:

AND(
  {Phone 1} = "{{phone}}",
  {Phone 1} != ""
)

 And you'd update the code for Phone 2 and Phone 3 accordingly

See Solution in Thread

2 Replies 2
TheTimeSavingCo
18 - Pluto
18 - Pluto

Hmm, is it that the result's "Phone 1" value is empty, and as a result it matches and thus returns it?  If so, perhaps you add an "AND" there so that it was:

AND(
  {Phone 1} = "{{phone}}",
  {Phone 1} != ""
)

 And you'd update the code for Phone 2 and Phone 3 accordingly

Yes! This is it. Obvious now that it's here in front of me. Thank you so much for your suggestion!