A FilterZen user enquired about the following requirement:
I have three SharePoint groups called Branch1, Branch2 and Branch3. What I want to have happen is that when user of Branch1 hit my list they only see Branch1's records. When Branch2 users connect they only she Branch2's records and so on.
An interesting filtering requirement we wanted FilterZen (our SharePoint Filter Web Part) to support fully. Starting with build 220.127.116.11 (the newest available for download at the point of writing), this can now be achieved with any User Filter.
Here's a quick walk-through on how to do this. Pre-requisites:
- This tutorial assumes you already have your FilterZen Web Part connected to your List View Web Part and the Column being filtered (that contains your user groups) is of the Column type People & Groups.
- You have already created a User Filter for that very Column.
- You are in the FilterZen Web Part edit mode and have its settings tool-pane open.
- You have enabled CAML Direct filtering mode in the Filtering Mode section of the FilterZen Web Part settings tool-pane.
So first you'll need to open the filter editor for your User Filter by selecting it in the list of filters and clicking the Edit icon. Inside the User Filter editor, scroll down to its Apply and Discard buttons and you should see the Customize user columns (advanced) link:
When you click it, the editor will scroll back up and expose two new property settings at the top: value Column and display Column. Simply type the name GroupLink in the value Column and then Apply your changes:
That's it. Instead of sending the name of a given user, this User Filter now sends (as multiple filter values) the names of all groups the user belongs to — and we have already tested this functionality against People & Groups Columns, too.
What about the display Column? For interactive User Filters, this still defaults to showing the user name if you leave it blank. To have it show the user group names instead, again type GroupLink here, too.
What if the filtered Column contains People, not Groups? Then and only then, change the filter operator (expand the Advanced Filter Properties section) from Equals to is member of Site Collection user group.