Create a Simple SharePoint 2013 Employee Directory on Office365 – Part 1 – Introduction

Employee Directories are a common feature of most Intranets. In fact, I’m working on Employee Directories for two different clients right now.

Bonzai Intranet Employee Directory Example

Bonzai Intranet Employee Directory Example

This is such a common need, that it’s firmly embedded in the fantastic work that my friends over at Dynamic Owl have built into their Bonzai Intranet product. We aren’t going to be able to do something as fancy as there is in Bonzai. But with a little work – not much coding at all – we can build a perfectly good Employee Directory for a small- to mid-sized organization.

There’s a great article by Ari Bakker (@aribakker) out there that shows how to set up a simple a Employee Directory on SharePoint 2013: How to: Create a Simple SharePoint 2013 People Directory. For this series, I owe credit to Ari for getting me started and showing me the main path. I encourage you to read Ari’s post as well.

On Office365, there are some nuances, however, plus I wanted to add some secret sauce to what I implemented. The example I’ll run through in this series is similar to the Bonzai approach, but uses mostly out of the box capabilities. The one “coding” piece is the custom Display Templates I’m using to show the alphabetic search across the top of the search results and the specific columns we want in the table listing.

Here were some of my requirements:

  • Show all current employees by default, with paging set at 50 (the maximum available with search results)
  • Display a simple to use filter based on the first letter of the last name, indicating which last name letter is currently active
  • Only “light up” letters of the alphabet when at least one person has a last name starting with that letter (no links that lead to no results)
  • Show appropriate refiners in the Refinement Panel
  • Display the search results in a more tabular way to imitate the [often Excel-based] phone listing which is common in smaller organizations
  • Offer some other sorting capabilities within the current view

My hope is that by following the steps in these posts, you’ll be able to build a simple but useful Employee Directory for your organization or clients. In the specific case I’m working on now, the organization has about 100 active employees. Based on your organization’s size and specific make up, you will probably want to tweak things along the way.

Here’s a view showing roughly where we’ll end up:

Employee Directory

If there are specific requirements you have that I don’t mention here, please add them into the comments and I’ll try to cover them.

Series NavigationCreate a Simple SharePoint 2013 Employee Directory on Office365 – Part 2 – Set up an Employee Directory Page >>

16 Comments

  1. Show only:People who are currently in the organization: If they have an external email address, then don’t show them (This is the case for Office 365 “external users”.) If there is some way to identify that the user is no longer a member of the organization, but still has a profile entry, then leave them off the directory.

    Reply
    • Marcel:

      Not to spoil the surprises or anything, but the quick answer to your requirements here are:

      • For the “current employees” thing, we’ve come up with some filtering based on the values in Department.
      • We also needed to exclude some system-type accounts, and so we check the AccountName for the string “membership”. That string will only exist in accounts based on claims. I think something like this will work for the external accounts as well.

      For all of this, there probably isn’t a single answer. As you know, everyone uses Active Directory differently – far too differently – so there will be a bit of trial and error required for each tenant.

      M.

      Reply
  2. Hi Marc,

    Thanks for the wonderful post.

    Is it possible to provide the display template for download ?? I want to have the approach with alphabet sorting for AD.

    Thanks

    Reply
  3. Hi Marc,

    When I append contentclass=spspeople in the Basic Query Text field I do not get any results when I click on a specific letter.
    Thoughts?

    Mike-

    Reply
    • Found the issue. You need to put a space between {searchboxquery} and contentclass=spspeople. Without the space the pages loads correctly on load and “All” but not when a specific letter is clicked.

      Reply
  4. Hi Marc

    I have now been using this for about six months and is working well. One issue I do have is performance. When it creates the A-Z it performs 26 REST queries each one takes between 350 and 525 milliseconds which is about 10 seconds. I am of the old school, as you well know, and am still using On-premises SP2013 SP1 May 2015 CU. So batch queries are not available. (I still don’t think they are on premises) So is there an alternative way of generating the A – Z which does not take so long ? BTW I have modified this to work with Lists and Page Libraries.

    Regards

    Nigel

    Reply
    • Nigel:

      You *could* disable the 26 queries altogether. If you know which letters are in use, then you don’t need to go to all the trouble to figure it out on every page load. Or, you can just “light up” every letter, not worrying about whether there’s anyone behind each one.

      M.

      Reply
  5. Hi Marc, Great Series!! Is there an easy way to add additional attributes to the Item Display template such as birthday and Mobile Phone? I tried editing the .html file and matching the SPS attribute property name but all I get is blank info. Not sure if those variables need to be declared elsewhere.

    Thanks.

    Reply
    • @Michael:

      In order to display a field, it has to be a managed property. On Office 365 you can’t create new managed properties, but you can use the RefinableStringxx, RefinableDatexx, etc. fields. My guess is that the fields you are trying to display are not set up that way.

      M.

      Reply
  6. Hi Marc,
    I’ve added a refinement panel to the page, but when I click on any of the items in the refinement panel it causes the visibility to be hidden in the search results.
    If I F12 and inspect the code and remove the visibility: hidden value on the webpart, the results are what they should be. I don’t know how the visibility: hidden is being set.

    Thoughts?

    Reply

Have a thought or opinion?