Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to dynamically construct a couple of URLs for our SharePoint users to filter down a rather large list view we have. Rather than create a bunch of different custom views, I was wondering if there is a way to just pass some URL arguments to the AllItems.aspx page and have the filter be applied during page load.

I envision maybe create a text box where they can type a question like "DocumentID" and give it a value of "12345" - then have javascript construct an appropriate URL like:

http://server/site/Lists/Links/AllItems.aspx?MyFilter=DocumentID:12345
share|improve this question
add comment

4 Answers 4

up vote 4 down vote accepted

If you filter manually, you'll see that the URL changes, e.g. to something like

http://server/site/Lists/Links/AllItems.aspx?FilterField1=DocumentID&FilterValue1=650

So if you pass the parameters FilterField1 and FilterValue1 accordingly, it should work.

share|improve this answer
    
This worked like a charm - exactly what I was looking for. Thanks! –  Goyuix Jun 25 '10 at 15:04
    
it's don't work when you have to filter multiples lists –  user9181 Jun 29 '12 at 1:03
add comment

I wouldn't recommend customizing a regular SharePoint view page in this way. You could create another page though outside of the list or library and put a dataview on there that uses the URL input property.

share|improve this answer
add comment

To use the query string parameters as filters you can use the Query String Filter Web Part and connect to a List View Web Part on a Web Part page.

share|improve this answer
1  
Keep in mind that the Filter Web Parts require an Enterprise license. –  Mike Oryszak Jun 25 '10 at 0:49
add comment

Heres a post i wrote to demonstrate how we can filter a SharePoint list view web part with JavaScript.

Uses the same concept as suggested by Modery

http://rahul-vartak.blogspot.com/2010/08/sharepoint-2007-filtering-list-view-web.html

Hope this is useful..:)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.