Use Current User Filter to display items based on User’s Department

In this article, we will see how we can display list of items relevant to user based on his/her department.

Let say we have a list “Employees” which store employee details along with “Department” info.

Employees

Now we can create a different Site Page or a View and perform the steps there or we can simmly utilize the current “AllItems.aspx” page.

Lets edit the current page itself and add “Current User Filter” web part.

EditPage

We need to set this filter first. From the web part menu, select “Edit Web Part”. On web part settings page, under “Filter” section, for “Select value to provide” select “SharePoint profile value for current user”. In this dropdown, select “Department”. Click ok.

SetFilter

We need to connect this filter to list web part to filter the results. From the web part menu, select “Connections” -> “Send Filter Values to” -> “Employees” list web part.

ChooseConnection

In the “Connection Type”, select “Get Filter Values From” and click “Configure”. On the configure connection screen, select “Consumer Field Name” as “Department”.

ConfigureConnection

Click Finish. Stop editing the page. Navigate to this page fresh and see the results reflected.

Results

This way we can configure any User Profile property to be used as filter.

Hope this helps.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s