Help

URL Parameter for filter on a view

7694 11
cancel
Showing results for 
Search instead for 
Did you mean: 
Bob_Perez
4 - Data Explorer
4 - Data Explorer

Newbie question here! I searched the forum and couldn’t find what I needed.

Wondering if it’s possible to share a read only link to a view with a URL parameter that filters to only show the records that match the parameter value?

Specifically, we have a field called “Group ID” that serves as a parent/master identifier that we use to group records together. I would like to share a read-only link with the Group ID value added on the end as a parameter. The viewer would then only be able to view records that had that particular Group ID. I’m able to dynamically generate the URL and send each time with a different Group ID and only want the viewer to see the records for that Group ID referenced in the URL they received.

The general idea is: www.airtable.com/viewid/?groupid=123456 would only show records that had a value of “123456” for the Group ID field.

I’m not sure how to set up the view and/or field or how to structure the URL :frowning:

From what I see hints of, this can be done but I couldn’t find specifics. Can someone point me in the right direction?

Thanks

11 Replies 11

I don’t think this can be done in the URL - filter, sort, and group are done via JavaScript in the browser, not through URL parameters (you can see this by the fact that if you preview a shared view URL and then apply a filter, it does not reload the page or change the URL at all).

The only way to package a filter into a shared view is to build it into the view to start with - in other words, you need to build a View in your base for each Group ID filter, and each one will have a unique share URL.

Thanks Jeremy.

That’s a bummer. I was hopeful. Unfortunately it’s not practical to build views for each Group ID, since we could have hundreds of Group IDs each month. Yeah, I noticed that same thing, that the URL didn’t change, that should have been my first clue, ha.

Holding out hope for some sort of workaround. :slightly_smiling_face:

If not, upon further consideration I could possibly work with having one filter on one view that everyone can see, I just need to add a couple more criteria. Was hoping to be more targeted in what I was sharing but oh well!

Thanks again Jeremy.

Richard_Murray
4 - Data Explorer
4 - Data Explorer

I personally think it would be very powerful to be able to apply filters in the urls for linked views using conditions in an existing table. Either that, or the ability to bulk create views based on a field’s value.
Thanks for this post though - saved me a ton of time in research and experimentation, I suspect.

This would be super powerful. You could build website cms collection urls that opened Airtable reports filtered for a product or client and the like.

Alan_Houser1
5 - Automation Enthusiast
5 - Automation Enthusiast

Yes, this would be fantastic.
I’ve been working on TWO tables for USA and UK theater showtimes, where the USA table needs to load sorted by STATE; the UK form loads sorted by COUNTRY. I’d rather just have one table + add html links “UK” “USA” (etc) above the table. Manual filtering is “OK”, but most normals aren’t NECKBEARDS. :nerd_face:

Robert_Tolmach
4 - Data Explorer
4 - Data Explorer

Some time has passed since the last reply. Has anyone come up with a solution?
Another alternative for AirTable to consider, instead of putting the filter in the URL: let the account owner create a table of external users (view sharers), with the table showing the name, the access URL (provided by airtable?), and two columns for the filtering: FIELD and VALUE. So, in one row of the table, you could pick Field =company, and Value = Tesla. Then, that URL would only show rows with company name = Tesla.

Moe
10 - Mercury
10 - Mercury

Our search tool for Airtable supports URL parameters. So you can consider it a dynamic view generator.

Fabian
5 - Automation Enthusiast
5 - Automation Enthusiast

This is probably what you were looking for:

Dean_Arnold
7 - App Architect
7 - App Architect

@Fabian correctly pointed out that one can easily filter records in shared views, by adding the filter URL parameter to the shared view link, as described in the above Airtable post.

The problem is that you cannot do the same for your internal, non-shared views.

In other words, you cannot dynamically filter non-shared views.

You have to manually create new views and preset their filter conditions.

Unless…

Unless…

Nope! I don’t think it can be done!

Any ideas @Jeremy_Oglesby, @Justin_Barrett

Dynamically driving view filters is possible. In fact, the primary view in my personal task system is effectively a dynamic filter that is constantly updating throughout the day to show me different groups of tasks based on specific criteria.

For example, in the morning, I start out by only seeing a collection of tasks that are part of my morning routine. Part of that routine involves arranging the primary tasks in my day into defined time-based groups: AM, PM, and evening. Once time-group assignment is done and I complete the task that’s tied to it, the tasks for the AM group become visible. The tasks for the PM and Eve groups only appear at their assigned times throughout the day. While all of this goes on, I never touch the filter because it’s targeting a single formula field that is reacting to what’s happening with a bunch of other fields, most of which are other formula fields or rollup fields (and those rollups are most often pulling from more formula fields in other tables).

During the short stretch of time in early 2020 when I was working full-time, I updated the system to allow me to switch between completely different collections of tasks—personal and work in my case—with a single click, all still run through the same filter targeting the same formula field.

So yes, dynamic filters are possible. It’s just a matter of designing a system to support them.

Absolutely, but you still have to predefine those conditions and there isn’t an easy way to jump to a custom filtered view. Not in the way Airtable allows you to do it with URL params for shared views.

When I say ‘dynamic filtering’, I’m talking about a filtered, non-shared view based on new data and without having to create or edit new views.

For example, when a new record appears in one table, and you want to query and display some results in a different table according to the data in the new record.

I was able to stitch together a solution that works like this:

  1. Airtable button directs the user to a URL including a URL parameter for the Airtable Record ID

The webpage posts an Airtable Webhook including the Record ID
The webpage redirects the user to the URL for the Airtable filtered view (filtered according to some markers to be set in the next step)

  1. The Airtable Automation is triggered by the Webhook from the previous step

Airtable gets the original table record using the Record ID,
Script queries another table for required conditions
Script adds markers to found records (And we filter for these marker fields in the view we redirected the user to)

A few extra steps are needed to make it work smoothly, such as a time delay in the web page script and the clearing of some field values in the automation, but you get the gist.

While it is a bit hacky, it can be used to display a dynamically filtered view in one table, using any set of data from a different table, and the user only has to click one button.

I got the idea from one of your other posts. You suggested that the user click a checkbox that triggers an automation, adds the marks to found records on the other table and ultimately shows the filtered records inside the records list app. That worked great but I wanted my users to go directly to a view where they could immediately start editing. Hence the need for using some javascript on a web page.

Thanks for helping me get through it!