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

People picker issue when try to search by full name but works with upn

Open Igli1994 opened this issue 1 year ago • 11 comments

Hello i am using last version of the package but i have a problem with PeoplePicker it suggest when i search by upn but it will not suggest if i search by full name ..

Igli1994 avatar Jan 19 '24 23:01 Igli1994

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

ghost avatar Jan 19 '24 23:01 ghost

Thank you for submitting your first issue to this project.

github-actions[bot] avatar Jan 19 '24 23:01 github-actions[bot]

Hello @Igli1994

Could you please share the code synopsis on how you have defined PeoplePicker control.

Thanks, Nishkalank

NishkalankBezawada avatar Jan 31 '24 19:01 NishkalankBezawada

Hello @NishkalankBezawada, I am also facing the same issue. Please find below, the implementation in my code. It works fine when I try to search by upn (Akshat.agarwal) or "agarwal, akshat" but it fails to provide any results when I search for "Akshat Agarwal"

image

Thanks!

akshataggrwal avatar Feb 15 '24 09:02 akshataggrwal

Hi @akshataggrwal & @Igli1994,

I tried on my side with the provided code snippet, without encountering any trouble, whether I search by UPN or full name (both first and last name).

May I ask to both of you to check the following:

  • Does the native People Picker in a Person field behaves correctly if you try to search by full name? (even if I know that it's not querying the same API, just to ensure)
  • What's the network trace when you're querying the PnP Controls' People Picker with both working and malfunctioning input?
    • Meaning what's inside the _api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser call, both payload and return

michaelmaillot avatar Apr 13 '24 15:04 michaelmaillot

Hi @michaelmaillot,

Upon inspecting the OOB SPO people picker field(which work correctly), it appears to be using the same API(/_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser), with the inclusion of an additional parameter called 'UseSubstrateSearch.' and that is the only difference between the two queries.

However, I've found limited documentation on this parameter.

image

Related - https://github.com/pnp/sp-dev-fx-controls-react/issues/1534

akshataggrwal avatar Apr 15 '24 11:04 akshataggrwal

As I'm not able to repro your issue and as I agree that there's no documentation around this API, may I suggest you to run the Controls locally, udpate the searchTenant method by including this UseSubstrateSearch and test the PeoplePicker control with the ControlsTest webpart, provided in the repo.

michaelmaillot avatar Apr 22 '24 11:04 michaelmaillot

Hi @michaelmaillot,

Apologies for the delayed response.

I tested the web part locally by including this property, and it now searches for users based on full names as well.

image

Thanks!

akshataggrwal avatar May 18 '24 11:05 akshataggrwal

Hello,

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

michaelmaillot avatar May 24 '24 07:05 michaelmaillot

Great! Thanks for the update @michaelmaillot.

Is it reasonable to expect this fix to be included in the next release?

Thanks & Regards Akshat Agarwal

akshataggrwal avatar May 24 '24 08:05 akshataggrwal

We'll try to 😉

michaelmaillot avatar May 24 '24 13:05 michaelmaillot

Hello,

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

Thanks again everyone for raising & taking time to dig into this one!

michaelmaillot avatar Aug 10 '24 20:08 michaelmaillot