Help

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

Topic Labels: Views
Solved
Jump to Solution
2702 5
cancel
Showing results for 
Search instead for 
Did you mean: 
11136
5 - Automation Enthusiast
5 - Automation Enthusiast

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?

1 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

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

See Solution in Thread

5 Replies 5
ScottWorld
18 - Pluto
18 - Pluto

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

11136
5 - Automation Enthusiast
5 - Automation Enthusiast

got it. so helpful. thanks

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.

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.