I’m working on an app that needs to filter the table in some way. It doesn’t look like there is a way to update the filters in the app. Is this correct?
Can I apply a filter from a custom app?
Best answer by Justin_Barrett
Thanks for the reply, Justin! Yes, I’m creating a custom app. It needs to filter the records in a table somehow. I looked for apps that do this, but couldn’t find one. They seem to recreate the table inside the app in full-view mode. Is this this the only approach?
If you get a Table instance from a base, there are methods on the table instance (selectRecords() and selectRecordsAsync()) that will let you get a RecordQueryResult. This has a records property that will return an array of all records on the table. From there you would use the standard JavaScript filter() method on that array to filter them as desired.
All of this is very similar to how you’d retrieve and filter records in other scriptable parts of Airtable, though the API is slightly different (and more robust). If you’re not already referring to the custom app API docs, I strongly recommend bookmarking it for future reference.
Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
