Friday, July 27, 2012

SP2010 - Dynamic List filtering - without code, using just the URL

You have a list and you want to filter the list using a URL.

Normally you would do it like this:

http://myurl/sitename/listname/Forms/AllItems.aspx?FilterField1=Country&FilterValue1=America

This is great and you can extend it to include other columns by using FilterField2,FilterValue2,FilterField3,FilterValue3    and so on.

But what if you want to filter the same column with more than one value, using FilterField options will only allow one filter per column.  So in comes "FilterName and FilterMultiValue"

To use, its simple

http://myurl/sitename/listname/Forms/AllItems.aspx?FilterName=Country&FilterMultiValue=America;South Africa

BAM! you now have a filter on the same field, its an OR filter, but its still great :)

No comments:

Post a Comment