Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: People Directory - User filter #575

Open
1 of 3 tasks
outforever opened this issue Jun 1, 2022 · 8 comments
Open
1 of 3 tasks

Feature Request: People Directory - User filter #575

outforever opened this issue Jun 1, 2022 · 8 comments

Comments

@outforever
Copy link

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

The People Directory plugin is almost perfect! The challenge would be that i have a thousand or so users who are "guest" or "non staff" and i want to filter those users out. I would like to request a feature where the people directory can be limited to just staff based on some property (OU, metadata on the account, job title, group membership, etc)... really any way to filter them.

Observed Behavior

My entire o365 directory is displayed in this plugin, including users who should not be displayed.

Steps to Reproduce

Install plugin, notice that all users are displayed, irrespective of their employment status.

Submission Guidelines

@ghost
Copy link

ghost commented Jun 1, 2022

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Jun 1, 2022
@bcameron1231
Copy link
Collaborator

Hi! Thank you. We can definitely add this as an enhancement if you'd like. You can actually do this yourself on the SharePoint People result source. The Web Part uses this result source to find employees. You should be able to add whatever KQL query you want on that resource source and filter our the results.

Here is a link to some documentation
https://docs.microsoft.com/en-us/sharepoint/manage-result-sources

@outforever
Copy link
Author

I just tried to create a query for this but it broke search on the rest of the website :( and it still did not work.
Do you happen to know the syntax? I was trying like:

(contentclass:STS_ListItem OR IsDocument:True) WorkEmail:DOMAIN , which was scoped to the people picker only, as all the users i want are in a specific domain (there are service accounts in there too, but one problem at a time...).

However when i made it default for the site, all other search broke. Your web part does not seem to have a configurable searching scope like in this screen shot:
https://www.sharepointdiary.com/wp-content/uploads/2018/05/search-results-web-part-change-query.png (from https://www.sharepointdiary.com/2018/05/limit-search-results-to-specific-content-source-in-sharepoint-2016.html)

I am not a programmer so the fact that its open source code is irrelevant to me. Would be a nice feature to have in your product.

@bcameron1231
Copy link
Collaborator

Hi, it's unclear exactly what you are trying to do. Adding STS_LIstItem or IsDocument:true would break People search because the results are not list items or documents. You should just be able to the workEmail filter. However, Search doesn't support a prefix search so the domain search would be a little difficult to do. Are there any other properties you could filter on?

@outforever
Copy link
Author

An active directory group i could do it on.

The users to be filtered out have their own AD group. They have a seperate domain (email domain, user principal domain).
cant do by title, there are too many. Most of the accounts i would filter have numerical usernames while the regular accounts i want to show up do not....

@kasperbolarsen
Copy link

If you are looking for a guide on how you can clean up your people search, you might want to have a look at https://ms365thinking.blogspot.com/2023/05/sharepoint-people-search-how-to-clean.html

@outforever
Copy link
Author

Well sure that would be great, if the plugin allowed you to use any sort of filtering. When i click to edit the webpart, all i get is "no settings to change for this web part", so not sure exactly where i would type in these filter parameters.

I found one item at the following location that may be how i would filter for every query on the site (not the best, but would work for me)

site settings -> manage query rules -> "local people results service" -> "people name in people search"

however you cant edit that query rule, as i assume its built in(read only). Can you define a custom query rule and make it default for this? and the plugin would pick that up? maybe thats what you mean that i should do?

@kasperbolarsen
Copy link

Hi, I am working on added a People Directory into the Starter Kit using the PnP Modern Search web parts. Perhaps you will be able to reuse some or all or this. I intend it to look like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants