In this post we will discuss how to work with Current User Filter in SharePoint 2013 Online. We will use Current User Filter web part with a list view web part. In this particular example I have a sample list which has two columns one is Title and CreatedByFirstName. Here we will filter the records based on logged in user’s first name.
SharePoint has inbuilt filter criteria presented with [Me] which will work with People picker field type, like Created by [Me] or Modified by [Me]. But this will be helpful in other cases where you will not have a people picker, may be a single line text and you want to filter on other user profile properties like first name, last name, department etc.
– Deploy Administation approved InfoPath forms in SharePoint 2013
– SharePoint 2013 online Show color in different color based on status column value in SharePoint 2013 using Calculated column
– SharePoint 2013 Document library checkboxes missing after migration from Moss 2007 to SharePoint 2013
Here is our list.
Now let us say I am logged in with Bijay Sahoo and here I want to filter records based on First Name. So If I open it should show records where the filter criteria “CreatedByFirstName” is Bijay.
So for this I have created a sample web part page. In that page First I add the list view web part (MyTest List).
For this Edit the page -> Add web part then from Categories select “Apps” and then select MyTest list from the list of apps, then click on Add. Once you will Save the page it will display all the records.
Now again Edit the page and click on Add a Web Part. Then From the Categories Filters -> then add “Current User Filter” web part as shown in the fig below:
Then select web part and then click on Edit Web part as shown in the fig below:
Then in the Current User Filter web part properties, you can see like below. It will display Current user name in the format of i:email@example.com.
But here our requirement is to filter based on the First Name. So I need logged in user’s first name. So for this select the second radio button “SharePoint profile value for current user”. Now in this dropdown it will show what are the prorpeties (user profile properties) are available.
From there select Last Name as shown in the fig below. You can select as per requirement like department, last name, username, workemail etc. Then click on OK.
Then edit the web part again. click on Connections -> Send Filter Values To -> Then select the list [Here it is MyTest]. Here make sure pop up is enabled here.
Then it will display the Choose connection popup. Here in the Connection Type select “Get Filter Values From” and then click on Configure as shown in the fig below:
Then in the next screen (tab). Be default the “Provider Field Name Current User” will come. In the Consumer Field Name select the list column name which you want to filter. Like here I want to filter based on CreatedByFirstName column from the columns dropdown as shown like below:
Then click on Finish. And Stop editing and Save the page.
Now if you will refresh the page, you will be able to see the items created by loggedin users first name as shown in the fig below:
Hope this will be helpful.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.