Setup a staff directory in SharePoint
One of the most common requirements for an intranet is a staff directory. In this post I want to discuss the simple ways you can setup a staff directory in SharePoint.
People Directory web part
The people directory web part is available as part of the SharePoint Starter Kit managed by the PnP team. It provides an A to Z of all users in your SharePoint tenant. The UI uses cards to display information about each user. Hovering on a user will display the standard pop up that you see throughout SharePoint when hovering on a user. The web part uses the People Search API to return results. This means the data is coming from SharePoint’s user profile service and not directly from Azure Active Directory. If you change a value in Azure AD, it is synced to SharePoint and will eventually be crawled by SharePoint search. If this delay is a problem, the next web part might be more suitable. It’s fairly easy to install the People Directory web part on your tenant.
- Download the SharePoint Starter Kit .sppkg file or alternatively, clone the SharePoint Starter Kit and build either the whole solution or the individual web part.
- Upload the sppkg file to your app catalog.
- Deploy the web part to your tenant.
- Add the web part to a modern page.
Staff Directory web part
The staff directory web part is available via the sp-dev-fx-webparts repository on PnP’s GitHub. The web part provides a search based UI, where you can search for any user in your Azure Active Directory. Using the web part settings you can decide which user properties are displayed. It’s worth noting that this is a dev sample and may not be production ready. It is still however worth testing out and will give you a significant head start if you have a requirement for a staff directory based on Azure AD directly. To install the web part, you will need to do the following:
- Clone the repository
- Build the package
- Upload the package to your app catalog and deploy to your tenant
- Go to the API Access page in the SharePoint Admin Center and Approve the permission to use the Microsoft Graph scope Presence.Read.All
These are quick ways of setting up a staff directory on your SharePoint tenant. The great thing about these solutions is that they are open source, so you can either use them as they are or you can customise them as you wish.