Jul 05, 2021 01:17 AM
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
Jul 06, 2021 08:12 AM
Standard Javascript would be:
!array.includes({name})
Jul 06, 2021 09:19 AM
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.