SharePoint Filter List / Library by Querystring

Written by Keith Tuomi on. Posted in Lists, SharePoint 2010

If you need to filter a list / library, but don’t want to have to make new View .ASPX files, it’s a simple but effective thing to know that standard Views accepts querystring filter values. So can you put in filter/order/etc. values directly into the URL to accomplish your goal. You could always batch create Views using PowerShell with a technique like the one described here, however if you want to keep things in one simple view then go with the query string approach.

http://go.mysharepoint.com/SiteName/LibraryName/Forms/ChangeLogMergeView.aspx?FilterField1=MyColumn&FilterValue1=Custom Value

You’ll need the following querystring values:

FilterField1 (first filter, column to filter by)
FilterValue1 (first filters, the string you want to filter by)

If you have multiple clauses to filter by, just add another pair of FilterField1 / FilterValue2 pairs, and increment by one, so:

http://go.mysharepoint.com/SiteName/LibraryName/Forms/ChangeLogMergeView.aspx?FilterField1=MyColumn&FilterValue1=Custom Value&FilterField2=MyOtherColumn&FilterValue2=Another Custom Value

The one to watch out for is the FilterField which is looking for the CAML Query-style name of the field. So if you wanted to filter by a field name that has spaces in it, you need to replace the spaces with _x0020_  (which represents a space character). So “Date Modified” becomes:

&FilterField1=Date_x0020_Modified

Incoming search terms:

  • SharePoint 2010 filter list by querystring contains
  • filterfield1 filtervalue1 space
  • SharePoint 2013 filter by URL
  • sharepoint 2013 filter list
  • sharepoint 2013 list of filters []
  • sharepoint 2013 querystring
  • sharepoint 2013 search query string
  • sharepoint filtervalue1 term
  • slideshare sharepoint list query string
  • sharepoint 2010 query string iframe

Tags: , , , ,

Trackback from your site.

Keith Tuomi

itgroove is a team of dedicated professionals specializing in Microsoft technologies for the small and medium sized business. Our SharePoint practise offers expert level assistance in architecting, implementing, and customising this industry leading collaboration platform.

Comments (2)

Leave a comment

Follow me on Twitter