Zieglers

Just little about C#, .NET, SQL Server, SharePoint and SAP

How to filter list values based on current user profile? UserContextFilter Web Part

Posted by zieglers on February 17, 2009

In this article I’ll try to show you how to use UserContextFilter web part. UserContextFilter web part can be used in situations where you’d like to filter other web parts based on a property value of the current user. Mostly this filter criterion is current user id. However, in some cases one may need to use any of the user profile property values such as Title, Department, and Email … etc.

For this article I chose a simple scenario: We’ll add a Tasks web part and by using UserContextFilter web part only tasks assigned to current user will be shown.

Here are the details:

  • 1. Create a Team Site and delete all web parts on default.aspx page.

101

  • 2. Add Tasks web part.

 102

  • 3. Add Current User Filter WP.

103

This web part is only viewable in edit mode, and it needs to be configured prior to use.

104

  • 4. Add a connection to Tasks web part.

 1051

  • 5. Select “Assigned To” as Consumer Field Name and click “Finish”.

106

107

  • 6. Test UserContextFilter web part.
  • a. Create a test user called “testuser

 108

  • b. Assign this user to the test site’s visitors group.

 109

 110

  • c. Before signing in as testuser, create a sample task for this user.

 111

  • d. Now sign in as test user. Tasks web part, which is being filtered by UserContextFilter web part, should be displaying testuser’s tasks as follows.

112

113

zieglers

Advertisements

3 Responses to “How to filter list values based on current user profile? UserContextFilter Web Part”

  1. On my site i can’t find or add the the Current user filter, it’s not there, not even in Site settings in the webpart Gallery where you can add new webparts that weren’t available. (Maybe I don’t recognize it). I use Sharepoint 2007, is it possible that this webpart (or any filter webparts) are not available in my installation?

  2. adele adkins naked…

    […]How to filter list values based on current user profile? UserContextFilter Web Part « Zieglers[…]…

  3. idesigns said

    idesigns…

    […]How to filter list values based on current user profile? UserContextFilter Web Part « Zieglers[…]…

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: