Formula in Search Records module of Airtable to search for domains of mail addresses

Hi, I’m building a scenario to label emails in Gmail from clients (listed in Airtable) with the label Clients.
I want to compare the domains of client-mail addresses in Airtable with the domain of the incoming email addresses in Gmail. I’ve entered this formula in the Search records module of Airtable: RIGHT({E-mail},LEN({E-mail})-FIND(’@’,{E-mail}))=RIGHT({{{1.from.address}}},LEN({{{1.from.address}}})-FIND(’@’,{{{1.from.address}}})) I get the runtima error: ‘The formula for filtering records is invalid:’, see screenshots. Can anybody help me how to accomplish this?


Thanks, Sandra

Hi @Sandra,

The formula looks good, however, it is not supported through the API and I presume that it runs just fine if you run it in Airtable directly. You need to slightly update the formula so that it works via the Make Module. What you want to do is, structure your formula like this,

RIGHT({Email},LEN({Email})-FIND(‘@’,{Email}))=“gmail.com

And, the second section i.e gmail.com needs to be evaluated on make itself, which you can do by using,

{{last(split(2.email; "@"))}}

So, your overall formula in Airtable Module will look like,

RIGHT({Email},LEN({Email})-FIND('@',{Email}))="{{last(split(2.email; "@"))}}"

P.S > Repace Email with your Airtable Column Name.

1 Like

Hi Runcorn,
Thank you so much! It works!