Sep 07 2022 02:49 AM
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?
Sep 07 2022 03:48 AM - edited Sep 07 2022 03:50 AM
You can try below default Managed Properties which worked fine for me
It will show values from below mentioned OOTB user profile properties so make sure these property contains values.
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
Below is the output of search result
Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community
Sep 07 2022 04:43 AM
@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.
Sep 07 2022 05:13 AM - edited Sep 07 2022 05:14 AM
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
Click and User Profile and Search for any user
Click on Edit Profile Property and the screen shot which I shared it taken from here.
Sep 07 2022 05:19 AM
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?
Sep 07 2022 05:26 AM - edited Sep 07 2022 09:06 AM
Solution
For that managed property is the OfficeNumber If you want to get only value but you can't use it for refiners.
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
Sep 07 2022 05:52 AM
@kalpeshvaghela thanks a bunch!!
Now we wait..
Sep 07 2022 05:55 AM
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
Sep 08 2022 01:33 AM
Sep 11 2022 11:07 PM
@@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?
Sep 13 2022 12:30 AM
Department still not showing in my filters - any idea what I am missing here?
From user properties:
From search schema:
Filter:
Results that only show Title (There is nothing when scrolling down):
Sep 13 2022 12:48 AM
Make sure that you connect your search web part to filter web part as well as shown in below screen shot:
Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community
Sep 13 2022 01:34 AM
@kalpeshvaghela thanks I did check this but no luck :(
It seems like something obvious I'm missing here.
Sep 14 2022 05:01 AM
Mar 15 2023 10:16 PM
Mar 28 2023 06:17 AM
Sep 07 2022 05:26 AM - edited Sep 07 2022 09:06 AM
Solution
For that managed property is the OfficeNumber If you want to get only value but you can't use it for refiners.
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