No, you can’t control a view with the API. The API is for interacting with records only, not modifying the Airtable user interface.
No, you can’t control a view with the API. The API is for interacting with records only, not modifying the Airtable user interface.
got it. so helpful. thanks
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 aempty] 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 nagain] 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.