Thursday, April 22, 2010

Filter in List View using Query String

Filter in List View using Query String

It’s very easy to filter in built list view web part OR SPList in UI.
Below query string is filter list.
?FilterField1=[Internal Field Name]&FilterValue1=[Value of Filter Field]
For more understanding let’s take one example.
Here I created one sample List which contains Title, Date, City and Country Columns as per below.

Now I want to filter on Country Column so query string looks like
?FilterField1=Country&FilterValue1=USA
Happy Coding !!!

4 comments:

  1. Nice Post. help me.

    ReplyDelete
  2. Good One! but the same is not working with Calendar view, do we have any work around for the same?

    ReplyDelete
  3. Very good post!helped me a lot.

    ReplyDelete
  4. Is there anyway you can pass multiple values in the FilterValue1 parameter. So if you filter on country, you can return every item in the list that has 'USA' or 'Australia' or 'France' in the country field?
    Thanks

    ReplyDelete