---
title: "How to Build a Department or Office Directory Page with Employee Directory"
description: "Step-by-step scenario for building a SharePoint Online page that lists only one department, office, country or company with Vitextra Employee Directory: a filter in the Employee Directory (Entra ID) web part, a KQL Predefined Query with the User profiles source, columns, refiners, Group by, quick filters, A–Z navigation, pages for several offices and Microsoft Teams."
url: https://vitextra.com/en/support/kb/10467
language: en
published: 2026-11-08
modified: 2026-11-07
products:
  - "Employee Directory"
author: "Līga Ozola"
tags: ["department directory page", "office directory page", "SharePoint department staff list", "filter employee directory by department", "filter by office location", "filter by country", "multi-company tenant directory", "Employee Directory (Entra ID) filter editor", "Predefined Query KQL", "Department:\"Sales\"", "BaseOfficeLocation", "department site people list", "Microsoft Teams channel tab employee directory", "Vitextra Employee Directory"]
---

# How to Build a Department or Office Directory Page with Employee Directory

Step-by-step scenario for building a SharePoint Online page that lists only one department, office, country or company with Vitextra Employee Directory: a filter in the Employee Directory (Entra ID) web part, a KQL Predefined Query with the User profiles source, columns, refiners, Group by, quick filters, A–Z navigation, pages for several offices and Microsoft Teams.

## 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](https://vitextra.com/en/products/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](https://static.vitextra.com/articles/10467/department-page-en.png)
*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:

| Approach | Web part and source | How the scope is defined | Suitable for a scoped page |
|---|---|---|---|
| **Recipe A** (recommended) | **Employee Directory (Entra ID)** | A filter built in the visual filter editor, on any column or custom column | Yes |
| **Recipe B** | **Employee Directory** with the **User profiles** source | A KQL condition in **Predefined Query** | Yes |
| **Recipe C** | **Employee Directory** with the **Entra ID (Azure AD)** source | Only **Show only users with non-empty department** | No |

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](https://vitextra.com/en/support/kb/10310).

## Before you begin

- The Employee Directory solution is installed - see [KB10035. How to Install a Vitextra Product in SharePoint Online](https://vitextra.com/en/support/kb/10035) - and its ::Microsoft Graph:: permissions are approved - see [KB10360. How to Approve Microsoft Graph API Permissions for Vitextra Solutions in the SharePoint Admin Center](https://vitextra.com/en/support/kb/10360).
- You can edit the page of the department or office site.
- **Check the data.** Both the filter and the query compare the values stored for each person. Find out exactly how the department, office, country or company is written - for example, `Sales` or `Sales Department`, `Riga` or `Riga HQ`, `LV` or `Latvia` - and whether it is filled in for everyone who should appear on the page. A person whose value is missing or spelled differently won't be shown.

## 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](https://static.vitextra.com/articles/10467/filter-department-en.png)
*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](https://static.vitextra.com/articles/10467/filter-group-en.png)
*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](https://vitextra.com/en/support/kb/10312).

### 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](https://vitextra.com/en/support/kb/10311).

## 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](https://static.vitextra.com/articles/10467/predefined-query-en.png)
*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](https://vitextra.com/en/support/kb/10313). 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.

| Page | Recipe A: filter editor | Recipe B: Predefined Query |
|---|---|---|
| One department | **Department** **Equals** `Sales` | `Department:"Sales"` |
| Two departments | Group (**OR**): **Department** **Equals** `Sales`; **Department** **Equals** `Marketing` | `(Department:"Sales" OR Department:"Marketing")` |
| One office | **Office Location** **Begins with** `Riga` | `BaseOfficeLocation:Riga*` |
| One city | **City** **Equals** `Riga` | Requires a mapped managed property |
| One country | **Country/Region** **Equals** `Latvia` | Requires a mapped managed property |
| Several spellings of a country | Group (**OR**): **Country/Region** **Equals** `Latvia`; **Country/Region** **Equals** `LV` | Requires a mapped managed property |
| One company in a multi-company ::tenant:: | **Company name** **Equals** `Contoso Baltics` | Requires a mapped managed property |
| One department in one country | Top level (**AND**): **Department** **Equals** `Sales`; **Country/Region** **Equals** `Germany` | Requires a mapped managed property for the country |
| A job family | **Job Title** **Contains** `engineer` | `JobTitle:"Engineer"` |
| A cost center or another custom attribute | Add the attribute under **Custom Columns**, then **Cost Center** **Equals** `4100` | Requires 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](https://vitextra.com/en/support/kb/10060).

## 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](https://vitextra.com/en/support/kb/10313).

### 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](https://static.vitextra.com/articles/10467/office-page-grouped-en.png)
*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](https://vitextra.com/en/support/kb/10314).

### 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](https://vitextra.com/en/support/kb/10214).

![The Quick Filters group on a department page](https://static.vitextra.com/articles/10467/quick-filters-settings-en.png)
*The Quick Filters group on a department page*

### A–Z navigation, search box and totals

- **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](https://vitextra.com/en/support/kb/10040).

## 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](https://static.vitextra.com/articles/10467/teams-department-en.png)
*A department directory in a Teams channel*

## Troubleshooting

| Symptom | What to check |
|---|---|
| The page shows nobody | The 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 missing | Their 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 appear | In 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 nobody | The visitor belongs to another department than the page - turn the quick filter off on department pages |
| The Teams personal app shows only one department | **Save Settings** was selected on a scoped page - save the configuration again from the company-wide directory |

## Related articles

- [KB10311. How to Configure the Employee Directory (Entra ID) Web Part: Filters, Exclusions and A–Z Navigation](https://vitextra.com/en/support/kb/10311)
- [KB10312. Employee Directory (Entra ID): Filter Editor Reference](https://vitextra.com/en/support/kb/10312)
- [KB10309. How to Add and Configure the Employee Directory Web Part](https://vitextra.com/en/support/kb/10309)
- [KB10313. How to Set Up the Refinement Panel in Employee Directory](https://vitextra.com/en/support/kb/10313)
- [KB10314. Employee Directory Layouts: Details and Cards, Card Size, Card Fields and Group By](https://vitextra.com/en/support/kb/10314)
- [KB10214. Employee Directory Quick Filters: My Department, My Team, People I Work With, Favorites](https://vitextra.com/en/support/kb/10214)
