SharePoint Filter List / Library by Querystring

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

4 responses to “SharePoint Filter List / Library by Querystring”

  1. Hey Keith,

    Thanks for sharing the knowledge! I was playing around with this and I was able to get it working, but was wondering if there was a way to filter multiple fields, but with an OR clause:

    FilterField1=xxx&FilterValue1=xxx
    OR
    FilterField2=xxx&FilterValue2=xxx

  2. Hi Keith,
    Is there a way to use Library QueryString to call up the most recently added document in a list or folder?
    I’d like to dynamically call up display that document in a web page.
    Thanks for your time,
    Bruce

Leave a Reply

I've been low-key stressed about how to view the many email inboxes I have in Outlook in one view without having to scroll and hunt for new messages.

The 'macro' method in this video works great.

View Multiple Inboxes at Once in Outlook 365 https://youtu.be/NpFSsovHgVo via @YouTube

We help Department of Defense clients realize benefits such as faster decision making, total traceability, and automated updates by identifying targeted goals and putting an emphasis on a culture of adoption through buy-in by individual team members.

https://bit.ly/3IRc68a

How to: Create a report quickly from a #SharePoint list or library in the #PowerBI service
📈📉📊📈📉📊
https://bit.ly/3vbKfMD
#Microsoft365

Leverage Microsoft Project for the web with the Project Accelerator https://youtu.be/Hxr8dncHmT8 via @YouTube

Load More...