Wednesday, November 28, 2007

Filtering a SharePoint View from the QueryString

Clever little tip from Aggarwal Saurabh - you can filter the contents of a SharePoint list view by appending a couple of querystring values to the address.

For example, if you have a list view including a field named "ProductID", you can filter a preset list view to only show items for a Products with ID "123" by adding the following querystring to the page URL:

?FilterField1=ProductID&FilterValue1=123

Could be handy!

4 comments:

Andrew Backway said...

Just a note, this will also work even if the column isn't displayed in the current view.

rage2001 said...
This comment has been removed by the author.
rage2001 said...

hey. this is a deadly article... I almsot have this project complete due to finding your article... But one thing I was to do, is it possible to add more fields and instead of doing an AND type query, do an OR. So it would be if field1=this or field2=this..

?FilterField1=PrimAppoint&FilterValue1=Classics&FilterField2=SecAppoint&FilterValue2=Classics

Above would be if both are equal, but what if one or the oither is equal? Any ideas? my email is swwalsh@swgc.mun.ca

Geetha said...

Hi,

Helpful article. Its working fine for the list views except the Calendar view. Do we have a work around for Calendar Views too. Kindly let me know.