MOSS 2007 comes with a number of filter web parts that makes it really easy to filter your SharePoint lists by connecting filter web parts with list view web parts.
Note: These are only available in MOSS enterprise edition and could only be applied to “All Items” view or to view configured as “Standard View” type
I would walkthrough in this tutorial to filter a list items based on User Location (mapped to Office profile property in the User Profile repository).
There are list of courses stored in a custom list called “Courses”. The requirement is to display courses only available in current logged user’s location. The easiest way would be to create a view on the list and set the filters. Ironically, there is not inbuilt [Location] attribute like [Me] or [Today]. You could filter the view on [Me.Office] as shown below
The other way is to use the Current User Filter. With the Current User Filter you can filter the contents of web parts by using any property of the current user.
1. Create a List called Courses
2. Add couple of items to this list with different location. Make sure one record have location same as your location. In this example, current user’s Office profile property has value as “Melbourne”.
3. As the list page is a web part page, you could easily add web parts to this using User Interface.
4. Click Site Actions -> Edit Page
5. On the top of the list, click “Add a new Web part” and select web part “Current User Filter”
6. Edit the newly added web part “Current User Filter” by clicking Edit -> Modify Shared Web part
7. Click “SharePoint profile value for current user” and select “Office” from dropdown
8. Press OK.
9. Now, we need to make a connection between this web part and courses list. On “Current User Filter” web part, click Edit -> Connections and Select Courses
10. You would be prompt with a dialog box, select the List field which need to be mapped to the User’s Office attribute.
11. Click Finish and Exit the edit mode. You would now only see the items in list which have location same as your Office.