Airtable - Search records: formula filter by linked record?

Hello,

I have a workflow in which I’d like to search for matching user records in Airtable by using the formula filter to match them with a record they’ve been linked to (an Action they’ve been assigned.

The first part of my workflow looks like this:

When the webhook is triggered, it captures the Action record ID, and the Get a Record module uses this record ID to find the record in the Actions table.

Then, in the Search records module, I’d like to search for records in my Users table, but only those contain the same Action (i.e. they’ve been assigned to it).

I’ve tried to write the filter like this:
image

…as I assume the field is an array because it can contain multiple linked records.

However, this throws up an error.

I don’t suppose anyone would know how to correctly write a “contains” formula like this?

Many thanks and kind regards,

Matt

Hi @Matt_J,

If I am not mistaken there is no way to search for Linked Fields using the formula directly through the Record ID. There are a few workarounds for it though, the easiest being instead of using Record ID we can do is search it through the Primary Field of the Events Actions table.

Let’s say, if the name is the primary key in the Event Actions table then what you can do is,

You can either use the SEARCH or FIND formula to do this,

SEARCH(“ACME Construction”, {Name})

  • For this, ACME Construction will be the value that you get from Second Get a Record Module.
  • Name = Events actions - assigned to(i.e the field name in the table that you are querying against)

Let me know if it makes sense, another option will be to have a Rollup field in Airtable that we can utilize to do a search by using the array function to have a column of Linked Record ID as a comma-separated value in which we can then use FIND formula. I will see if I can find a suitable solution in Airtable Community for this.

Maybe you can post this in Airtable community and see if you get better response over there as it is more related to Airtable and how it function.

2 Likes

Hi @Runcorn,

Many thanks for the quick and details response. Your explanation makes perfect sense (I think!), and it looks like it worked!

Initially it was throwing up an error (“The operation failed with an error. [422] Invalid request: parameter validation failed. Check your request data.”), but I think that may have been due to the output fields specified being copied from a different scenario… So I disabled them all, and voila. Shame initial issue wasn’t clearly flagged!

Thank you again for your help, I think I should be able to configure the rest of the workflow similarly to a previous one now :slight_smile:

Have a great day.

Matt

1 Like