Skip to main content
Solved

Create API Endpoint that returns a list of records based on an array of record IDs

  • October 7, 2022
  • 2 replies
  • 28 views

Forum|alt.badge.img+4

Hello I’m trying to query one of my tables and only return a list of records based on a list of record IDs. How would I write the filterByFomula query?

I tried to join a series of queries like

filterByFormula=(AND((_id%3D'{{record_id_1}}'),(_id%3D'{{record_id_2}}')))

However this didn’t work.

Best answer by kuovonne

Welcome to the Airtable community forums!

Try writing the formula in an Airtable formula field to test it out. You will need to use OR() instead of AND(). You will also need a different formula field that reveals the record ID of each record.

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • Answer
  • October 7, 2022

Welcome to the Airtable community forums!

Try writing the formula in an Airtable formula field to test it out. You will need to use OR() instead of AND(). You will also need a different formula field that reveals the record ID of each record.


Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 5 replies
  • October 7, 2022

Welcome to the Airtable community forums!

Try writing the formula in an Airtable formula field to test it out. You will need to use OR() instead of AND(). You will also need a different formula field that reveals the record ID of each record.


OO of course. It worked when I switched it to OR. Thanks for the help!