Filter results using Profile terms

The Compliance Tracker 365 PnP Search Extension has the ability to insert user profile terms into search queries to filtered results.

These terms can optionally be targeted to only show mandatory content, optional content or personally targeted content for reading. Queries can also filter content containing any matched profile term, useful to show any relevant content, no matter how it’s tagged.

Steps to add profile terms into a query:

Register the Extensibility libraries in the search result web part.

  1. Navigate to the last page in the search web part properties, enter the following and click Save:
    Name: CT365
    Manifest GUID: 626583b8-7f47-429d-9d10-238a524a1b70
    Enable: On

  2. Navigate to Available connection tab, under Custom Query modifiers click Configure query modifiers

  3. Enable the CT365 Profile Replacer and click Save

  4. Scroll to the bottom of the pane, and update the Profile Term with any of the following:
    CT365-Mandatory, CT365-Optional, CT365-Raw, CT365 or CT365-Personal.

  5. Check the Query Template in the first page includes {searchTerms}. This is swapped out with the user profile terms and any search terms at runtime.

User Profile Service integration

Profile terms can be also be added to a CT365-UserProfile property in the User Profile Service (UPS) which can then be used by other processes, including search. This option is less flexible than the Custom Query modifier when using the PnP Search web parts but it is more accessible to other systems should it need integration.

To enable this feature, create a new CT365-UserProfile property in the UPS as per the screen shot below. Whenever a profile changes, the value is updated for use in search.


To use the User Profile terms in search, add the following query to the Query Template:

 ({|tags:{User.CT365-UserProfile}|00000-0000-00000})

The use of 00000-0000-00000 will return no results if the property is not set.

To only show mandatory content, use the following query:

 ({|owstaxIdCTSGMandatory:{User.CT365-UserProfile}|00000-0000-00000})

There is a limit of 60 terms per person which can be saved into the UPS string field. Over this number, terms will not be saved.