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

react-directory - #4105

Closed
lpgru1 opened this issue Oct 11, 2023 · 2 comments
Closed

react-directory - #4105

lpgru1 opened this issue Oct 11, 2023 · 2 comments

Comments

@lpgru1
Copy link

lpgru1 commented Oct 11, 2023

Disclaimer

Yes

Sample

react-directory

Contributor(s)

@joaojmendes @petkir @sudharsank @Abderahman88

Question

Is it at all possible to limit the People results that appear to only come from a particular group or department? I am looking for a way to display a live directory at a school, but I only want to display 'Staff' and not 'Students', however by default they all display due to all being members of the Organization.

I currently use SharePoint Term Store Taxonomy to differentiate between "Staff" and "Students" elsewhere, and I feel like this would be the optimal way to use this react-directory if I could get it to only display organization members listed as "Staff" in the Term Store?

Thank you all for the excellent community and webparts.

@ghost
Copy link

ghost commented Oct 11, 2023

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

@ghost ghost added the Needs: Triage 🔍 label Oct 11, 2023
@petkir
Copy link
Contributor

petkir commented Oct 15, 2023

Hi @lpgru1

Thanks for your message.
The fastest way is to customize the code of this sample
in the File /src/SPServices/spservices.tsyou find the method searchUsers and you can add additional query parameter for your needs to the variable _search

i think the query property is Department but I'm not sure please look at your tenant {your ulr}/_layouts/15/listmanagedproperties.aspx?level=sitecol

as result it should be something like this (this code is not tested)

_search += ' and Department: Staff'

The other way is to add a web part property to inject the query over the UI.
Feel free to make a contribution

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