Overview

A company-wide directory answers "who works here?". A department or office site needs a narrower answer: "who is in Sales?", "who works in the Riga office?", "who is employed by our German subsidiary?". With Vitextra Employee Directory you can build such a page from the same web parts you use for the main directory - you only limit the people the web part shows and adjust the layout to the page.

This article is a worked scenario. It shows how to:

  • limit the directory to one department, office location, country or company;
  • choose the columns, refiners, grouping and card layout that suit a scoped page;
  • decide which quick filters to keep;
  • create the same page for several offices;
  • bring the scoped directory to Microsoft Teams.

The individual settings are described in detail in other articles; this one links to them instead of repeating every option.

A department directory page

A department directory page built with Employee Directory

Choose the approach

How you limit the directory depends on the web part and its data source:

ApproachWeb part and sourceHow the scope is definedSuitable for a scoped page
Recipe A (recommended)Employee Directory (Entra ID)A filter built in the visual filter editor, on any column or custom columnYes
Recipe BEmployee Directory with the User profiles sourceA KQL condition in Predefined QueryYes
Recipe CEmployee Directory with the Entra ID (Azure AD) sourceOnly Show only users with non-empty departmentNo

Use Recipe A when your people data is maintained in Microsoft Entra ID - it needs no query language and works with any attribute, including custom ones. Use Recipe B when your directory already relies on SharePoint user profiles and search, for example on custom profile properties.

💡 Tip
For a full comparison of the two directory web parts, see KB10310. Employee Directory vs. Employee Directory (Entra ID): Which Web Part to Choose.

Before you begin

Recipe A: Employee Directory (Entra ID) with a filter

The Employee Directory (Entra ID) web part reads all users from Microsoft Entra ID and applies its filter in the browser. The filter defines who belongs to the page; visitors can't remove it.

Create the filter

  1. Open the page, select Edit and add the Employee Directory (Entra ID) web part.
  2. Open the property pane (the Edit web part pencil icon) and expand the Data Source group.
  3. Under Filter, select Edit Filter. The Advanced filtering panel opens.
  4. Select Add › Condition.
  5. In the condition, select the field Department, the operator Equals and enter the value Sales.
  6. Select Save. The web part shows only the Sales department, and the filter preview in the property pane reads [Department] Equals Sales.
  7. Republish the page.

A Department condition in the Advanced filtering panel

A Department condition in the Advanced filtering panel

The field list of a condition contains every column configured under Columns and Custom Columns - whether or not the column is shown in the list. You can therefore hide the Department column on a department page and still filter by it.

📝 Note
All text comparisons in the filter are case-insensitive. Equals requires the whole value to match; Begins with and Contains match part of it, which helps when the values differ slightly, for example Riga, Riga HQ and Riga, Floor 3.

Combine conditions

Each level of the filter has an AND / OR toggle. AND requires every condition at that level; OR requires at least one.

  • Alternatives. To show the Sales department and everyone in the Riga office, add two conditions at the top level and switch the toggle to OR: Department Equals Sales and Office Location Begins with Riga.
  • A scope plus alternatives. To show the Sales and Marketing departments in Germany, keep the top level at AND with Country/Region Equals Germany, then select Add › Group, set the group to OR and add Department Equals Sales and Department Equals Marketing inside it. The result is Germany and (Sales or Marketing).

A top-level condition combined with an OR group

A top-level condition combined with an OR group

❗ Important
Groups are always combined with the rest of the filter using AND, even when the top level is set to OR. Groups can be added only at the top level. When you need alternatives together with other conditions, put the alternatives into one group set to OR, as in the example above.

For all fields, operators and more examples, see KB10312. Employee Directory (Entra ID): Filter Editor Reference.

Combine the filter with exclusions

The Exclude Employees group removes accounts that are not real employees before the filter is applied - the filter only narrows the result further. On a scoped page the useful combination is usually:

  • keep Exclude blocked users on (the default), so former employees of the department don't appear;
  • turn on Exclude Unlicensed Employees if shared mailboxes or room accounts carry the department or office value;
  • turn on Exclude Employees with blank Department when you use a negative condition such as Department Does not equal Sales: Does not equal and Does not contain also match people whose field is empty.

The exclusions are described in KB10311. How to Configure the Employee Directory (Entra ID) Web Part: Filters, Exclusions and A–Z Navigation.

Recipe B: Employee Directory with User profiles and a Predefined Query

With the User profiles source, the Employee Directory web part finds people through SharePoint search. The scope of the page is a KQL (Keyword Query Language) condition in Predefined Query.

  1. Add the Employee Directory web part and open its property pane.
  2. In the Data Source group, set Data Source to User profiles.
  3. In Predefined Query, replace the default value * with your condition, for example Department:"Sales".
  4. Leave Show hidden users off to exclude SharePoint profiles marked with SPS-HideFromAddressLists.
  5. Check the result on the page and Republish it.

A Predefined Query for one department

A Predefined Query for one department

Points to keep in mind when writing the query:

  • It is added to every search. The web part adds the query to the text a visitor types in the search box, so people can only search within the department. The My department quick filter adds the visitor's own department to it.
  • Use standard people properties. Department, JobTitle and BaseOfficeLocation (the office) are standard managed properties of SharePoint people search, for example JobTitle:"Engineer" or BaseOfficeLocation:Riga* (the trailing * matches values that begin with Riga).
  • Combine with OR in capitals and parentheses, for example (Department:"Sales" OR Department:"Marketing"). Use explicit AND when all conditions must hold.
  • A property restriction matches words in the value. Department:"Sales" can also return people from Inside Sales or Sales Operations. Check the result and make the value more specific if necessary.
  • A query with a syntax error returns no results, and profile changes appear only after SharePoint search has crawled the user profiles again.

📝 Note
To filter on a property that isn't a standard managed property - for example a country, a company or a custom profile property - it must be mapped to a managed property in the SharePoint search schema. The mapping procedure is described in KB10313. How to Set Up the Refinement Panel in Employee Directory. If your data is in Microsoft Entra ID, Recipe A is usually simpler.

Recipe C: why the Entra ID source of Employee Directory doesn't fit

The Employee Directory web part can also read people from Microsoft Entra ID (Data Source › Entra ID (Azure AD)). With this source the Predefined Query box isn't available: the only restriction is the Show only users with non-empty department toggle, which hides accounts without a department but can't select a particular one. The Refinement Panel group isn't available with this source either, and the Employee Directory web part has no A–Z navigation.

This source is therefore not suitable for a department or office page. If your people data is in Microsoft Entra ID, use the Employee Directory (Entra ID) web part (Recipe A).

Example filters

The table shows common scoped pages and how to define them in each recipe. Replace the sample values with the values used in your directory.

PageRecipe A: filter editorRecipe B: Predefined Query
One departmentDepartment Equals SalesDepartment:"Sales"
Two departmentsGroup (OR): Department Equals Sales; Department Equals Marketing(Department:"Sales" OR Department:"Marketing")
One officeOffice Location Begins with RigaBaseOfficeLocation:Riga*
One cityCity Equals RigaRequires a mapped managed property
One countryCountry/Region Equals LatviaRequires a mapped managed property
Several spellings of a countryGroup (OR): Country/Region Equals Latvia; Country/Region Equals LVRequires a mapped managed property
One company in a multi-company tenantCompany name Equals Contoso BalticsRequires a mapped managed property
One department in one countryTop level (AND): Department Equals Sales; Country/Region Equals GermanyRequires a mapped managed property for the country
A job familyJob Title Contains engineerJobTitle:"Engineer"
A cost center or another custom attributeAdd the attribute under Custom Columns, then Cost Center Equals 4100Requires a mapped managed property

💡 Tip
To filter on an attribute that isn't in the built-in column list, such as an on-premises extension attribute, add it under Custom Columns first - see KB10060. How to Display Custom Entra ID Attributes in the Employee Directory Web Part.

Fine-tune the page

Once the scope is set, adjust the layout so that the page shows what is useful for this particular audience.

Columns

On a department page every person has the same department, so the Department column adds nothing. In Data Source, select Configure under Columns, turn off Show in list and Show on card for Department, and show the columns that differ between people instead - Job Title, Office Location or a phone number. On an office page, do the opposite: keep Department and hide Office Location.

Refiners for sub-filtering

The refinement panel lets visitors narrow the page further - for example, by job title on a department page or by department on an office page. Turn on Enabled in the Refinement Panel group, select Configure under Refiners and add the refiners:

  • in Employee Directory (Entra ID), select a column, such as Job Title, in Refine by. The refiner values are calculated from the people who pass the filter, so a Sales page offers only the job titles that exist in Sales;
  • in Employee Directory with User profiles, enter a refinable managed property name, such as JobTitle, after checking that it is refinable in the search schema.

For the details, see KB10313. How to Set Up the Refinement Panel in Employee Directory.

Group by and card layout

In the Appearance group, Group by splits the page into sections: by Job Title or Office Location on a department page, by Department on an office page, or by Last name (first letter) for an address-book layout. A column doesn't have to be shown in the list to be offered in Group by.

For a page that people browse rather than search, the cards view usually works best: set View to Contact, choose the card Size, and pick the lines in Content Fields (Header, Secondary and so on) - for example, the name, job title and office on a department page.

An office page grouped by department

An office page grouped by department

❗ Important
Grouping is applied to the people loaded on the page. With paging, a group contains only the people loaded so far. On a small department page, set Display items in pages of: high enough to show everyone; in Employee Directory (Entra ID) you can set it to 0 to show all people at once. See KB10314. Employee Directory Layouts: Details and Cards, Card Size, Card Fields and Group By.

Quick filters

The Quick Filters group has a toggle for each quick filter. Review them for a scoped page:

  • My department is redundant on a department page: for members of the department it repeats the page, and for visitors from other departments it shows nobody, because it narrows the already filtered list to the visitor's own department. Turn it off there. On an office or country page it is useful - it shows the visitor's own department within that office.
  • My team, People I work with and Favorites are personal lists. In Employee Directory (Entra ID) they respect the administrator's filter and exclusions. In Employee Directory they use separate lists and bypass Predefined Query, so they can include people from other departments. Disable them in Recipe B if the page must remain limited to one department.

For what each quick filter shows, see KB10214. Employee Directory Quick Filters: My Department, My Team, People I Work With, Favorites.

The Quick Filters group on a department page

The Quick Filters group on a department page
  • Show alphabetical navigation (in the Appearance group of Employee Directory (Entra ID)) adds a row of last-name letters. The letters are taken from the people who pass the filter, so they match the page. On a small department page you can leave it off.
  • Display Search Box - search filters the current list, including a selected personal quick filter. Turn the search box off for a short, fixed list, such as a team of ten people.
  • Show Totals shows how many people the page contains - useful as a headcount on a department or office page.

Create pages for several offices

To give every office, country or company its own page, configure one page completely and then copy it:

  1. On the finished page, select + New › Copy of this page in the page command bar.
  2. In the copy, edit the web part and change only the value in the filter (for example, Riga to Tallinn) or in Predefined Query.
  3. Change the page title and Republish the page.

Each web part keeps its own properties, so changing the filter on one page doesn't affect the others - and the Teams personal app isn't affected either.

📝 Note
Web parts on the same SharePoint origin share a browser cache of the user list. A cached list older than 24 hours triggers a background refresh when the web part loads; a manual refresh can reload it sooner. Keep the columns, custom columns and blocked-user exclusion consistent across copied pages. After changing which attributes are loaded, refresh the data to populate the newly requested values.

💡 Tip
To give the directory a full-width page of its own without other web parts, see KB10040. How to Create a Single App Page with Vitextra Employee Directory.

Department directories in Microsoft Teams

The Employee Directory personal app in Microsoft Teams uses one configuration for the whole tenant. An administrator saves it with Save Settings in the Personal app (Microsoft Teams) group of the property pane: "You can save the current configuration as a default one for your tenant. Personal App hosted in Microsoft Teams uses this configuration." Every user who opens the personal app sees this configuration.

❗ Important
Don't select Save Settings on a department or office page. The saved configuration includes the filter, the Predefined Query and the quick filters, so the personal app would show only that department to everyone in the organization. Save the personal-app configuration from a page with the company-wide directory.

Scoped directories belong where the department's audience is:

  • On the department's SharePoint site - the pages described in this article.
  • In the department's team - add the department's SharePoint page to a channel as a SharePoint tab; this works with every recipe. The Employees app can also be added as a channel tab, but it opens the Employee Directory web part, so only Recipe B or Recipe C applies there. A channel tab has its own settings, which you configure when you add the tab, and the tenant-wide personal-app configuration isn't applied to it.

A department directory in a Teams channel

A department directory in a Teams channel

Troubleshooting

SymptomWhat to check
The page shows nobodyThe filter value doesn't match the directory (spelling, extra spaces, abbreviations); an Equals condition at the top level with AND that nobody meets; a syntax error in Predefined Query
Some people are missingTheir department, office or country is empty or spelled differently; they are excluded by Exclude Unlicensed Employees or Exclude Employees with blank Job Title; with User profiles, the profile hasn't been crawled yet or is hidden from address lists
People from other departments appearIn Employee Directory (Recipe B), a personal quick filter bypasses the page query; a Contains or KQL condition may match too many values.
My department shows nobodyThe visitor belongs to another department than the page - turn the quick filter off on department pages
The Teams personal app shows only one departmentSave Settings was selected on a scoped page - save the configuration again from the company-wide directory

Questions and answers

Ask a question about this article and get an official answer from our team.

No questions yet. Be the first to ask.

Featured Articles

How to View Previous Policy Acknowledgements and Receipts

Find completed assignments, inspect recorded policy receipts and understand the difference between a receipt, a carried assignment and a document snapshot.

3 min
Cascading Filters: Narrowing Drop-Down Options by Other Selected Filters

How the Cascading filters option of the Vitextra List Filter Online web part limits the options of drop-down filter controls to values that exist in the items matching the other selected filters: enabling the option, an example scenario, behaviour details, performance considerations and limitations.

104 7 min
Error Correction and Size: Making QR Codes Reliable to Scan and Print

Reference for the Error Correction and Size settings of the Vitextra QR Code Generator web part: what the Low, Medium, Quartile and High levels mean, how the amount of data and a logo affect the code, how many pixels are needed for print, how large a printed code must be for a given scanning distance and why a margin around the code matters.

97 5 min

Share