Recent

CSWP Showing Personalized Results

Content Search Web Parts can show results specific for the current user.  The personalization options can be for the person’s organizational profile date (Department, Job Title, and Location) or self entered profile values (Interests, Skills or Ask me About). This functionality could be especially useful on a homepage if you want different departments or locations to see different data for example.

1A. Personalizing by Department, Job Title or Location

These three fields are usually populated by your organizational Active Directory and are usually not editable the end users:
cswp-personalization-1

All the departments, Job Title’s, and Locations for all the people in your organization should already be in your Organizational Term Store under ‘People’:
cswp-personalization-2

1B. Tagging your content with department/location/title

In this example we setup a CSWP to only show the current user announcements that have been tagged with their specific department (‘IT Department’ in my case).

1. Go to the list or library which you want to display personalized content, click on the List/Library tab and select List/Library Settings.
cswp-personalization-3

2. Under the Columns section, click on the Create Column option.
cswp-personalization-4

3. Enter a Column name, select the Managed Metadata type, Allow multiple values, and then expand the People term set and choose either Department, Job Title or Location, click the OK button to create the column.
cswp-personalization-6

4. You can now either create a new item on your list/library, or edit an existing item:
cswp-personalization-7

5.  You can specify a department by starting to type and selecting from the popup menu OR by clicking on the tag icon which will allow you to browse all the options.
cswp-personalization-8

6. You items should now have one or more departments selected.
cswp-personalization-9

 

1C. Configuring the CSWP to show Personalized Results

7. Add or Edit a Content Search Web Part on a page.

8.  Edit the web part, click the Change query button.
cswp-personalization-16

9. Configure your Query to return items from your desired list or library
cswp-personalization-19

10. Add a property filter for the owstaxidmetadataalltagsinfo property that contains a value that you entered on your list (IT Department in this example):
cswp-personalization-22

11. Test your query, the result preview should show any items that we tagged with that term (IT Department).
cswp-personalization-18

12. Replace the text value after owstaxidmetadataalltagsinfo: with {User.Department}, {User.SPS-JobTitle}, or {User.Location}.  You can now set the Sort order and then click the OK button to save your Query.
cswp-personalization-23

13. Select the max number of items to show, select the Item display template, and click OK to save the web part.
cswp-personalization-24

Completed Example

CSWP showing only the items where my department (IT Department) has been tagged:
cswp-personalization-25

2A. Personalizing by Skills, Interests or Ask me About

These three fields are optionally populated by your end users in their profile:
cswp-personalization-15

When someone enters a new skill, interest, or ask me about topic they are entered into the system as a new Keyword.

2B. Tagging your content with skills/interests/about

In this example we setup a CSWP to only show the current user announcements that have been tagged with one of the ‘Interests’ in their SharePoint profile.

1. Go to the list or library which you want to display personalized content, click on the List/Library tab and select List/Library Settings.
cswp-personalization-3

2. Under the Columns section, click on the Add from existing site columns option.
cswp-personalization-5

3.  Select the Enterprise Keywords column, click Add, then click the OK button to create the column on your list/library.
cswp-personalization-10

4. Click on the new Enterprise Keywords column.
cswp-personalization-11

5.  Rename the column to the type of keywords (Interests, Skills, etc) that you will be entering, enter a description of what you are looking for.  Click OK to save your changes.
cswp-personalization-12

6. You can now either create a new item on your list/library, or edit an existing item:
cswp-personalization-7

7.  You can specify a Keyword by starting to type and selecting the keyword the popup.  The item you select must be designated as a [Keywords] and not a metadata term from a different term store.
cswp-personalization-13

8.  Your item should now have 1 or more keywords specified.
cswp-personalization-14

2C. Configuring the CSWP to show Personalized Results

9. Add or Edit a Content Search Web Part on a page.

10.  Edit the web part, click the Change query button.
cswp-personalization-16

11. Configure your Query to return items from your desired list or library
cswp-personalization-19

12. Add a property filter for the owstaxidmetadataalltagsinfo property that contains a value that you entered on your list (‘Snowboarding’ in this example):
cswp-personalization-26

13. Test your query, the result preview should show any items that we tagged with the term (Snowboarding).
cswp-personalization-27

14. Since {User.SPS-Interests}, {User.SPS-Skills}, and {User.SPS-Responsibility} (Responsibility is what Ask me about is called) are all multi-value fields, we have to format the query as follows:
{|owstaxIdMetadataAllTagsInfo:{User.UserProfileValue}}
cswp-personalization-28

15. Once you are finished configuring the Query Text and Sort Order, click the OK button to save your Query.

16. Select the max number of items to show, select the Item display template, and click OK to save the web part.
cswp-personalization-24

Completed Example

CSWP showing only the items where one of my Interests (Snowboarding) has been tagged:
cswp-personalization-29

 

About Nick Hurst (84 Articles)
SharePoint and Nintex developer who strives to find easy to deploy and maintain solutions for business problems.

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 )

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: