Forum Discussion

WorkflowIQ's avatar
WorkflowIQ
Copper Contributor
May 28, 2025

SharePoint Pnp Search v4 People seach verticals issue with Location

I am trying to resolve an issue with SharePoint (online) PnP search v4 for an employee search page. 

I have a search box web part and filter web part for department and job title.  In my search results i can successfully retrieve results by typing the full or partial name of the employee into the search box. I can also filter the results by department or job title successfully using the PnP Search Filters webpart. The text in the PnP Search Results is "{?Title:{inputQueryText}*} Department:*". (I am also filtering out any users with the Department filed blank successfully)

I would like to use a search vertical web part to filter by location. I have set up the verticals web part with the default "all" tab with a value of "*" and other tabs with locations that match what has been entered into the Microsoft 365 user profile for the users. I was getting 0 results when selecting the search vertical tabs.

I have checked the mapping of the "baseOfficeLocation" managed property and it was mapped to People:SPS-Location and when that didn't work, based on some research, i changed the mapping to People:Office. That didn't make a difference. I also  mapped a spare refinableString managed property to People:Office. I checked to make sure the "People:Office" property in SharePoint user profiles was the correct property with values.

If i used the text "{?|(RefinableString01:{UserInput}" in the query template, in the search results web part, I was able to get successful filtering by location based on this new mapping, by typing into the search box the location name to get only users from that location, or "*"  to get all users with a location entered. This tells me that there are results getting retrieved. I have tried "RefinableString01:{vertical.value}" in the query template but that retrieves no results.

 

1 Reply

  • Hi WorkflowIQ​ 

     

    you can check user profile information in the SharePoint User Profile Application (UPA).

    - Check the values in your user profile (SharePoint Admin > More features > User profiles > Manage user profiles)

     

    - Check the properties and the field name (SharePoint Admin > More features > User profiles > Manage user properties)

    - Edit the property and you can see the internal name

    With this information go to the search admin center and check the crawled property.

    It is mapped to BaseOfficeLocation and others, that i use ;) :

    You can checkt the mappings Managed Properties section:

     

    You are ready for the search configuration now.

     

    - Use it as search filter

     

    - or in a query template to use it in verticals

    {searchTerms} * workemail:mehr365 AND BaseOfficeLocation:Lucerne

     

    Hope this helps.

     

    Best, Dave 

Resources