SharePoint 2010 - Using [Me] to Filter From Multiple Users

This article explores an additional a real-world scenario. The View Filter parameter "[Me]" can be used to filter one user as well as multiple users.

In our experiment, we have a List with a Members column, that allows multiple users:

  1. User1
  2. User2
  3. User3

We need to filter the list based on the current user. We can use the "[Me]" in the View Filter option.

Step 1: Create Projects list

Open your SharePoint site and create a List of type custom and name it "Projects".

Open SharePoint site

Open the List Settings and choose "Create Column".

Open List Settings in sharepoint

Enter the new column name as members of type Person or Group and allow multiple values, as shown below.

add new column in sharepoint

Click the "OK" button to continue. After adding the column your list columns looks as in the following.

add new column in sharepoint

Step 2: Create Users

We need 3 users for our scenario as in the following:

  1. If you are using a Windows client operating system then use the Control Panel to add the users
  2. If you are using a Windows server operating system then use Active Directory to add the users

User 1: Employee 1
User 2: Employee 2
User 3: Manager

Please ensure you have added a password for all 3 users (else certain browsers won't allow login).

Password for sharepoint site

Now we are ready with our 3 users.

You need to do the following to bring the preceding 3 users within SharePoint.

  1. Go to "Central Administration" > "Services" > "Stop User Profile Synchronization Service"
  2. Run the "IISRESET" command after a few seconds

Now, add the 3 users to the Site Members group. Open "Site Actions" > "Site Permissions" > "Find Members group" > "Add users".

sharepoint Site Permissions

Click the "OK" button and now the 3 new users have "Contribute" permissions to read/modify list items.

Step 3: Add Data

Now we are ready to add some data to the list.

Open the list and add Project 1 with Employee 1 and Manager.

Open sharepointlist

Open the list and add Project 2 with Employee 2 and Manager.

Open sharepointlist

Now we are ready with following 2 items.

sharepoint list items

Please note that Employee 1 has only 1 project associated with it and Employee 2 has only 1 project associated with it.

The current view shows both records, regardless of whoever is logged in.

Step 4: Create View Filter

Now we can create our View Filter. Go to the "List" Tab of the Projects list and click the "Create View" button.

View Filter in sharepoint

In the window that appears choose the "Standard View" as shown below.

sharepoint Standard View

In the page that appears, enter the view name as "Current User View" and make it the default, as shown below.

sharepoint Current User View

Scroll down to the bottom and in the Filter section add the following:

sharepoint Filter section

Please note that we are enabling a filter that checks if the Members column is equal to the current logged in user that is denoted through "[me]".

Click the "OK" button to continue.

Step 5: Test It

Now from the user menu on the right hand side, choose "Sign in as Different User".

Sign in sharepoint site

Sign in as Employee 1 and you should see the current items.

sharepoint current items

Please note that the the Employee 2 item is hidden as per the View Filter.

Summary

In this article we have explored the "[me]" parameter to filter multiple valued user columns.

Up Next
    Ebook Download
    View all
    Learn
    View all