Shared view URL filters
  • 17 Oct 2022
  • 4 Minutes to read
  • Dark
    Light

Shared view URL filters

  • Dark
    Light

Note
At the moment, some functionality listed in the article below is not available to all customers. We are currently rolling out new filter operators to have more options when constructing encoded share view URLs. 


After creating a share for your view you can add more filtering conditions to your records in the URL. For example, the URL https://airtable.com/shrsa57bWpEecPtzp?filter_Category=Brand%20identity will take you to a shared view where a condition is showing just the records where the “Category” field is “Brand identity”.

Users can easily remove this condition in the "Filters" menu, so you shouldn’t use this feature to hide private data. This feature does not limit what data is loaded, instead, it loads the entire original shared view, and then applies additional filtering conditions to it. In those cases, you might create a view in Airtable for each person and generate a share view link matching each person or consider using Interface Designer to share data with more granular permissions set.

4409867173143addurlfilter.gif


How to write a URL filter

To add filtering conditions you need to add to the query string of a URL. Query strings are a developer feature of websites, but in this article we’ll explain how to use them. You can also use Airtable formulas to help construct a query string.

To build a filtering condition, first, think about what you want to express in words. We’ll be building a share URL filter for this share: https://airtable.com/shrsa57bWpEecPtzp, one that represents that “The Category field equals Brand identity and the Project lead field contains Cameron Toth”. Our filter has two rules:

  • Category equals Brand identity
  • Project lead contains Cameron Toth

Filtering condition rules are written in the format filterxxxx_{Field}={Value} where you replace {Field} and {Value} with your own field and value. Query strings don’t support many characters like spaces or commas so you need to URL encode fields and values when they contain those special characters. You may also use the Airtable ENCODE_URL_COMPONENT() function in a formula field. So, for our category value to be used in the URL we would want to encode it as Brand%20identity, where %20 is a space.

Note
A field ID can be used instead of the field name. Field IDs are available through our API, or through the Field Manager (Pro and Enterprise only).

Back to the task at hand. Our first rule would be filter_Category=Brand%20identity because “Brand identity” has a space in it and the URL encoding for spaces is %20. Our second rule would be filterContains_Project%20lead=Cameron%20Toth because both “Project lead” and “Cameron Toth” have a space in them.

To combine the filter rules together into a query string you use the symbol. For example filter_Category=Brand%20identity&filterContains_Project%20lead=Cameron%20Toth.

Then take your share URL, which in our case is: https://airtable.com/shrsa57bWpEecPtzp, and add a question mark (?) followed by your query string.

So, our final URL with our filtering conditions would be https://airtable.com/shrsa57bWpEecPtzp?filterEquals_Category=Brand%20identity&filterContains>_Project%20lead=Cameron%20Toth.

If your URL has a question mark already then that means it already has a query string. Make sure to remove the existing query string from your URL before adding a new one.


Supported filter operators

Note
Using the generic filter_ operator will typically yield the same result as thefilterEquals_ operator's output. However, by using filter_ Airtable will do its best to choose a filter that makes sense for the field you are filtering values by. For example, in multiple select fields, the filter_ operator would function more like the filterHasAnyOf_ operator. This would lead to a filter where if the field "has any of" the values set, then the records containing those values would be shown in the shared view.

The following filter operators can be used when constructing a custom share view URL:

  • filter_
  • filterEquals_
  • filterNotEquals_
  • filterContains_
  • filterNotContains_
  • filterGreater_
  • filterGreaterOrEqual_
  • filterLess_
  • filterLessOrEqual_
  • filterIsAnyOf_
  • filterIsNoneOf_
  • filterHasAnyOf_
  • filterHasAllOf_
  • filterEmpty_
  • filterNotEmpty_


Using "Or" between filters

When creating an encoded URL you will use the & symbol to combine multiple filters together as outlined in the example above. However, there may be times when you would rather filter records with the "Or" conjunction rather than the "And" conjunction. In these cases, you'll add the string &filterConjunction=or to the end of the encoded URL. So, using our use case above: 

  • If we modified the URL to be:https://airtable.com/shrsa57bWpEecPtzp?filterEquals_Category=Brand%20identity&filterContains_Project%20lead=Cameron%20Toth&filterConjunction=or
  • Then, any records in the view equaling "Brand identity" in the category field or containing "Cameron Toth" in the Project lead field would be shown.

In this way, each "And" conjunction in the resulting URL is modified to be an "Or" conjunction instead.

Note
Using the filterConjunction=or string in an encoded URL is all or nothing. This means that there is no way to create a mix of "and" and "or" conjunctions between filters.


Frequently asked questions

What kind of views support shared view URLs?

URL filters can be applied to Grid, Calendar, Gallery, Gantt, Timeline, and Kanban view shares.

I want to create a view to share with multiple people, but I want to filter the view for each person so they can't see the other people's records. Can I use shared view URL filters for that?

URL filters can be removed by anyone you send the link to so you shouldn’t use this feature to hide private data. In those cases, you might create a view in Airtable for each person and generate a share link for each group or consider using Interface Designer.

I'm stuck, where can I find help?

If you’re having trouble there are developers/experts who can help on our Community Forum.


Was this article helpful?