Is there a way to ADD FILTER in VIEW(table) by API?

hi. im trying to change the view with filter by api as i said. (outside airtable)
image

i read the api document. and tried to “filter by formula” by airtable encoder.

BUT as i understand it only support “GET records” which is not i want (to ADD filter in the view)

is there a way?

No, you can’t control a view with the API. The API is for interacting with records only, not modifying the Airtable user interface.

1 Like

got it. so helpful. thanks

1 Like

You’re welcome! Glad I could help!

There’s actually is a pathway to creating the desired outcome, but you might not like it. Here’s how I did it once.

  • If you’re into API development anyway, this approach should be well within your wheelhouse; my approached leaned on Google Apps Script long before script automation and script blocks existed, but it could be NodeJS or even script actions.
  • Imagine a dedicated [empty] table that matches the desired format of the table you want to build dynamic view results.
  • Now imagine an API process that listens for calls from Airtable that include filter specifications that are dynamic. For example, a button that calls your dynamic “view builder” or a script block that prompts for the filtering requirements.
  • The view builder (API process) simply transforms the filtering criteria into a collection of records that are pushed back into the empty view table.
  • User wants a different view? Prompt [again] for the filtering criteria; instantiate the new data set.

There are many reasons this is a terrible approach; it is a kludge without question, but it does provide a way for non-technical users to create new views of their data dynamically.

2 Likes

I create a checkbox field in my view and set the filter to be based on the checkbox. Then I use Scripting to set the checkbox to include only the records I want.

This isn’t as good as an actual filter for a view because default values for new records aren’t set. Sometimes I turn on grouping in the view to get default values.

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.