Have you ever wished that you could look at a large SharePoint list or SharePoint library and easily find only those items that were relevant to you? Perhaps you’d like to see all the Tasks where you are in the Assigned To field, or all of the documents you created in a Library. It’s easy enough to filter for those items on the fly by using the drop-down menu on the Column headings, but wouldn’t it be nice to see only those relevant items when you first navigate to that page? This post will show you how to create a SharePoint Library View (or List View) that filters for the current user who is logged in to the site.
Add a special filter to any Standard SharePoint Library View
It may seem obvious that this could be accomplished by applying a Filter to the View Settings, and it’s easy to see that you could create a filter for a particular user. However, there is a special filter criteria that can be applied that will match up the relevant Column (Created By, Assigned To, or any other Person or Group field) with the current logged in user. This filter can be applied to either Public Views (created by someone who has Design or Full Control permissions on the site or list/library) or to Private Views (which can be created by anyone with at least Contributor permissions).
Before we get started, it’s important to note that this technique only works when users are logged in to SharePoint with their specific SharePoint user account. In cases where users are logged in with a generic account, but the Column data will reflect an individual user, this technique isn’t helpful unless the user switches to their personal login.*
You may not realize it, but the built-in Tasks list template has such a view already in place. Choosing this view would match the current user with the ID in the Assigned To column, and show only those tasks where the current user has been assigned:
In this example, we have a library that contains document sets for bid proposals. Our goal is to create a new SharePoint Library View which shows only the documents where the logged in user is the Sales Person. We also want this to be the default view for that library, so that everyone who navigates to that Library’s page will see that view first; they can switch to a different view if needed at any time.
First, use your favorite method to start a new view. One handy method is to use the View menu drop-down and select Create View.
We want this new view to be a variation on the existing All Documents view, so click the link to copy it.
Add a View Name, and check the box to Make this the default view.
Scroll down to the Filter section. Choose Show items only when the following is true. Select the Sales Person column as the basis for the filter, then make sure the second field is set for is equal to. In the third column, rather than entering an individiual’s name, type [Me] as the criteria. Be sure to include the brackets! This special value is what will compare the Sales Person field to the ID that is logged in to the site.
Click OK at the bottom or the top of the page.
Now when Cynthia or Jared visits the Library, by default each will see only those proposals they are responsible for.
Want to know more about creating SharePoint Library Views and List VIews that help users get the information and documents they need quickly? Take a look at our SharePoint training courses such as Introduction to SharePoint – Using SharePoint Server 2010, Using SharePoint 2013 or Office 365 SharePoint, or for more experienced users, Designing Document Management and Records Management Systems in SharePoint.
* You may ask under what circumstances that would happen. In my previous organization, there were a number of dumb workstations throughout the organization, where users logged in not via Windows but through an alternate system. They could navigate to the SharePoint site, but the workstation passed only a generic Windows ID to SharePoint. That generic Windows ID had Read permissions on the sites, so users could browse, but if they needed to operate on the site with their personal Windows ID, they had to Log In as a Different User to pick up their individual permissions. In this case, in order for a [Me] filter to be useful, the user would have to switch logins from the generic to the individual first.