If a user property has an ampersand in the value then you will get the following result when the value is pulled through to people search, you can see that John Smith’s job title has been duplicated.

To work around this, navigate to:

{siteURL}/_catalogs/masterpage/Display%20Templates/Search/

You will find an HTML and an associated JS file for Item_Person. The associated JS file is generated from the HTML file, so we’ll edit the HTML file. Download a copy to your machine and open it up in a text editor.

In this example, the Job Title is the duplicated field, so we will look for JobTitle. You find the following:

Underneath the if statement, add $parsedTitle = displayJTitle.split(“\n”);

Then change the value in the HTML element to $parsedTitle[0].

This duplicates are separated by a new line, so this allows us to split this value and take the first instance of the job title. Which should leave you with the following:

Save this file and upload it back into /_catalogs/masterpage/Display%20Templates/Search/

Now when we search for John again, we will find his Jot Title is no longer duplicated, as the below screenshot.

If you are still faced with values duplicating in your people search please comment below or if you want to contact us and find out about our service please contact us using this Microsoft SharePoint page.

Get Up To Speed With SharePoint 2019!

Download Our FREE eBook...

 

Download SharePoint 2019 eBook

Comments