Skip to content

Development of a SharePoint Phone Directory Web Part

Our SharePoint phone directory web part lists members of configured Active Directory or security groups and displays details like job title, phone and email.

We recently received a request from a customer to build a SharePoint phone directory. The goal was to display users from Active Directory groups and security groups. For each person, the customer wanted to show information such as job title, phone number, email address, and more. In this post, we share how we built this SharePoint phone directory web part.

Default SharePoint People web part vs. our phone directory web part

SharePoint Online includes a default People web part that can show user profiles. However, the customer would have to add every user manually. Whenever group membership changes, it would also need to be updated by hand. To keep the effort as low as possible, the customer asked that all users of a configured Active Directory group or security group be displayed automatically.

We implemented the phone directory as an SPFx web part. An admin can configure the groups in the web part properties.

SharePoint phone directory: Web part settings

We read user information via the Microsoft Graph API and render it in the web part. When you hover a user, the component shows their details in a popover—the same behavior as the default People web part.

SharePoint phone directory: User information

Sorting users via drag & drop

Another requirement was the ability to order users within a group. We implemented this with drag and drop. When the page is in edit mode, drag and drop becomes active, and an admin can arrange users in the desired order.

SharePoint phone directory: User sorting

We store the order per group in a configuration file in SharePoint. On page load, we read the configuration and sort the users accordingly.

{
  "groups": [
    {
      "title": "Test",
      "orderedUserIds": [
        "flo@openinnovationhub.onmicrosoft.com",
        "verena@openinnovationhub.onmicrosoft.com",
        "josef@openinnovationhub.onmicrosoft.com",
        "cerima@openinnovationhub.onmicrosoft.com"
      ]
    }
  ]
}

Update: If the requirement is not just to display groups automatically as a phone directory, but to provide intranet people search with skills, profile maintenance, and search context, we describe the newer approach in SharePoint Intranet Phone Directory with a Skills Feature.

Related articles

SPFx 1.24: Testing today to help our customers tomorrow
EventBooking in Microsoft 365 Copilot: original product cards with a confirmed registration on the right and a follow-up question about the booked workshop on the left

SPFx 1.24: Testing today to help our customers tomorrow

We are exploring the SPFx 1.24 preview with our existing products. EventBooking in Copilot shows promising early results and gives us practical experience for future customer solutions.

Read more
Site App Catalog: Test SharePoint Apps Locally - The
Site App Catalog: Test SharePoint Apps Locally - The Complete Guide

Site App Catalog: Test SharePoint Apps Locally - The Complete Guide

How to set up a Site App Catalog in SharePoint Online: PowerShell, PnP PowerShell, or CLI for Microsoft 365. Perfect for admins testing SPFx solutions.

Read more
How to Update SPFx Products from Microsoft Marketplace
How to Update SPFx Products from Microsoft Marketplace – Complete Guide

How to Update SPFx Products from Microsoft Marketplace – Complete Guide

Microsoft hasn't yet integrated update functionality into the new App Management interface. Learn how to update your SPFx apps using the classic experience.

Read more

Questions about this topic?

We are happy to help you put this into practice in your environment.