sp-dev-fx-controls-react icon indicating copy to clipboard operation
sp-dev-fx-controls-react copied to clipboard

PeoplePicker search too strict for organisation formatting.

Open sweco-seerjf opened this issue 1 year ago • 5 comments

Thank you for reporting an issue, suggesting an enhancement, or asking a question. We appreciate your feedback - to help the team understand your needs please complete the below template to ensure we have the details to help. Thanks!

Please check out the documentation to see if your question is already addressed there. This will help us ensure our documentation is up to date.

Category

[ x ] Enhancement

[ ] Bug

[ ] Question

Version

Please specify what version of the library you are using: [ 3.13.0 ]

If you are not using the latest release, please update and see if the issue is resolved before submitting an issue.

Have not updated, but I saw no fixes for people picker in 3.14.0

Expected / Desired Behavior / Question

If you are reporting an issue please describe the expected behavior. If you are suggesting an enhancement please describe thoroughly the enhancement, how it can be achieved, and expected benefit. If you are asking a question, ask away!

Make search terms less strict. Will improve user experience because they can more freely search for an employee.

I am not sure if this issue is within your control. But if possible add fuzzy search?

If there are other solutions to this issue I would appreciate some suggestions how to solve it.

Observed Behavior

If you are reporting an issue please describe the behavior you expected to occur when performing the action. If you are making a suggestion or asking a question delete this section.

My organisation is using the format [Lastname, Firstname] (notice the comma) for employee avatars. Unfortunately this format seems to break the search functionality of the people picker. When searching for a employee the common way would most likely be to write their firstname then press space and then the lastname. But because "Firstname Lastname" != "Lastname, Firstname" no results show up.

Example 1: Typing only firstname or lastname is fine but as soon as you press space you no longer will match any employees.

Example 2: Typing lastname and if the employee the user is searching for have a common lastname; they need to include the firstname. But if the user do not include the comma "Lastname, Firstname" no results will show up.

Steps to Reproduce

If you are reporting an issue please describe the steps to reproduce the bug in sufficient detail to allow testing. If you are making a suggestion or asking a question delete this section.

I am not sure where this kind of formatting for avatar names are set, but I guess it is within the top level tenant? Or even withing the windows administrator?

If you are able to change this the problem will be quite obvious.

Thanks!

sweco-seerjf avatar May 10 '23 10:05 sweco-seerjf

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

ghost avatar May 10 '23 10:05 ghost

Thank you for submitting your first issue to this project.

github-actions[bot] avatar May 10 '23 10:05 github-actions[bot]

Hi @sweco-seerjf,

The problem is that the search is done using the /_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser API which apparently is restrictful depending on the search. And I've tried to use wildcards without success. We have limited properties available with this one.

I've had a look at the native UI for PeoplePicker controls and it's using Graph people endpoint, which accepts spaces after the first search sequence (first or last name).

Maybe an improvment idea could be to let developer choose to rely on SharePoint or Graph (with approved API permissions first of course).

And regarding the avatar names you're refering too, it's the "diplay name" / Canonical Name (CN) that is configured in AD / AAD: https://learn.microsoft.com/en-us/answers/questions/1073001/how-to-change-default-display-name-in-azure.

michaelmaillot avatar Sep 13 '23 13:09 michaelmaillot

Hi @michaelmaillot,

We've encountered a similar issue in our application. Upon inspecting the OOB SPO people picker field, it appears to be using the same API(/_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser), with the inclusion of an additional parameter called 'UseSubstrateSearch.' However, I've found limited documentation on this parameter. Do you have any guidance or insights on effectively utilizing this parameter in the PnP control to address the issue?

image

Thanks!

akshataggrwal avatar Feb 20 '24 07:02 akshataggrwal

Hello,

FYI I've submitted a PR with the ability to enable substrate search

michaelmaillot avatar May 24 '24 07:05 michaelmaillot

Hello,

Linked PR has been merged, the feature should be soon available in next beta release.

Thanks again @sweco-seerjf & @akshataggrwal for raising this!

michaelmaillot avatar Aug 10 '24 20:08 michaelmaillot