Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

How to Filter data with Record IDs not one of Array of IDs

Topic Labels: API
2371 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Sanchit_Bhatnag
4 - Data Explorer
4 - Data Explorer

I have a table with Large set of rows, I have an Array of Record IDs which I do not want to display in the result of records, how to do that?
I am using airtable API for JavaScript,
I have tried using filterByFormula but unable to understand what syntax to write for this exact functionality

Sign in - Airtable in this filterByFormula: "NOT({name} = '')" instead of '' I want to able to pass an array if possible, or any alternate solution for the same

2 Replies 2

Standard Javascript would be:

!array.includes({name})

Welcome to the Airtable community!

The syntax needs to match a valid Airtable formula. For this reason, I always recommend building your formula in the Airtable interface directly first. I also recommend reading through the formula field reference.

In this case, the NOT formula cannot accept an array. Instead you would need something like

AND(
  {name} != "name 1",
  {name} != "name 2",
  {name} != "name 3",
  {name} != "name 4"
)

There are other possible formulas, especially if you convert your array to a string.

Also you mention an array of record IDs, but you reference the field {name} in your formula. Note that the record id is not the same as the primary field of a record.