read office 365 AD data with people picker in react spfx app

deesha boodhun 6 Reputation points
2021-04-14T06:55:07.367+00:00

Hi Experts,

I have created a react app on the sharepoint framework and used office ui fabric/fluent ui people picker.

To pull data into the people picker, i made used of a rest api to fetch data from a sharepoint list. This worked just fine.

Now i want to pull data in the people picker and i want that data to be my office 365 AD users.

Please guide me on how to do so. Your help will be much appreciated.

Thank you in advance.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,997 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,677 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Jerryzy 10,571 Reputation points
    2021-04-14T09:25:42.293+00:00

    Hi @deesha boodhun ,

    I understand you want a People Picker resolve the Office 365 AD users instead of the users just inside a SharePoint list.

    Then I suggest you can use the "PnP People Picker" instead of Office UI Fabric People Picker as this People Picker supported to get Office 365 AD users directly once set up context, no need to use API get data and bind to People Picker, please check the link below for details:

    PeoplePicker

    And here is a complete code demo about using the PnP People Picker inside React SPFX:

    PnP People Picker in the SharePoint Framework(SPFx) webpart

    Thanks
    Best Regards


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.