SOLVED

PNP Modern Search People - Show Department/Office as filter

Brass Contributor

Hi all, 

We're using the PnP Modern Search, and I can't for the life of me get Department to show as a filter. 

I have tried adding ows_Department, Department, BaseOfficeLocation, anything really to filters, and it just wont get through.. 

Also tried adding ows_Department as Refinablestring02, but still no luck. My users do have an attribute but I can't for the life of me target it. If I go to Sharepoint > Search > People > Type in any location they do appear as I'd like them. 

How do I find out which attribute is presented as Department in my tenant? 


 

 

15 Replies

@EMIL_K_DIT 

 

You can try below default Managed Properties which worked fine for me

 

kalpeshvaghela_0-1662546873375.png

 

 

kalpeshvaghela_2-1662547490958.png

It will show values from below mentioned OOTB user profile properties so make sure these property contains values.

 

kalpeshvaghela_1-1662547451809.png

 

kalpeshvaghela_5-1662547700816.png

 

 

Another thing, above mentioned property would not able available as suggestion in Filter Field drop down but as it's combo box still you can enter it manually as shown below

 

kalpeshvaghela_3-1662547618131.png

 

Below is the output of search result

 

kalpeshvaghela_4-1662547661700.png

 

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

@kalpeshvaghela Thanks for your reply! Yes I have tried these but will give it another spin.  

Where is this screenshot from? I can't seem to find a similar one in my console. 

Screenshot 2022-09-07 at 13.43.06.png

@EMIL_K_DIT 

 

Screen shot is from SharePoint User Profile and follow below steps to open it

 

Open your SharePoint Admin Center using URL https://{TenantName}-Admin.SharePoint.com

 

Go to More Feature and Click on User Profile

kalpeshvaghela_0-1662552691910.png

 

Click and User Profile and Search for any user 

kalpeshvaghela_1-1662552721416.png

 

Click on Edit Profile Property and the screen shot which I shared it taken from here.

 

kalpeshvaghela_2-1662552783666.png

 

 

 

 

@kalpeshvaghela 

Thanks!

I can see the variable I want to get is in fact, Office.


In your example that's 131/1104. Do you have any idea how I can find out what this is in the search schema? 

best response confirmed by EMIL_K_DIT (Brass Contributor)
Solution

@EMIL_K_DIT 

 

For that managed property is the OfficeNumber If you want to get only value but you can't use it for refiners.

 

kalpeshvaghela_0-1662553469182.png

 

You have to map "People:Office" crawled property to any RefinableString*** managed property and then you could use it in refiners.

 

Important: It might take some time to fill RefinableString managed property which you use for existing user profile (According to my past experience it took 2 days !!!).

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

@kalpeshvaghela thanks a bunch!!

Now we wait.. 

Screenshot 2022-09-07 at 14.51.42.png

@EMIL_K_DIT 


You are welcome. Sharing is caring :)

 

If it will work for you then you can mark my response as best response or like my response so that it can be helpful to others in the community

 

My users are slowly appearing :)

Thanks a bunch! Answer marked.

@@kalpeshvaghela sorry for reviving this, but I have created a similar thread regarding Department here: https://techcommunity.microsoft.com/t5/sharepoint/pnp-modern-search-people-show-department-office-as... 

I am configured to Filter on 'Department' and users do have 'Department' in their user profiles added to 70 users this Friday as POC, but it just will not budge. Any chance you might have an idea what I am missing here? 

 

@kalpeshvaghela 

 

Department still not showing in my filters - any idea what I am missing here?

From user properties: 
 

Screenshot 2022-09-13 at 09.10.49.png

 

From search schema: 

Screenshot 2022-09-13 at 09.10.54.png

Filter: 

Screenshot 2022-09-13 at 09.12.46.png

Results that only show Title (There is nothing when scrolling down): 

Screenshot 2022-09-13 at 09.14.17.png

@EMIL_K_DIT 

 

Make sure that you connect your search web part to filter web part as well as shown in below screen shot:

 

kalpeshvaghela_0-1663055278879.png

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

@kalpeshvaghela thanks I did check this but no luck :( 

It seems like something obvious I'm missing here. 

Screenshot 2022-09-13 at 10.33.41.png

@EMIL_K_DIT not sure why but this solved it... 

Screenshot 2022-09-14 at 14.00.38.png

Hi, so after adding the RefinableString** with People:Office, what will it look like on the Filter Field (PnP Filters WebPart)... Will it show up as Office now?
Hello!

I'm having trouble getting this filter to work by department.
Even with addig these parameters in a RefinableString, my filter still doesn't work.
Have you done anything else ?

Thanks !

I
1 best response

Accepted Solutions
best response confirmed by EMIL_K_DIT (Brass Contributor)
Solution

@EMIL_K_DIT 

 

For that managed property is the OfficeNumber If you want to get only value but you can't use it for refiners.

 

kalpeshvaghela_0-1662553469182.png

 

You have to map "People:Office" crawled property to any RefinableString*** managed property and then you could use it in refiners.

 

Important: It might take some time to fill RefinableString managed property which you use for existing user profile (According to my past experience it took 2 days !!!).

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

View solution in original post