Use filters in Virtual Tenants

  • Last update on September 27th, 2024

Virtual Tenants are not available in the Essentials and Professional solutions, but they can be purchased as an add-on.

 

This guide explains how to use Boolean operators (AND, OR) in Virtual Tenant filters, with a focus on managing nested conditions.

Boolean operators

AND

When an “AND” condition is set, it will function as a classic Boolean operator. Therefore, only results that satisfy both criteria will be displayed.

OR

When an “OR” condition is set, it will function as a classic Boolean operator. Therefore, results that match either one of the criteria or both will be displayed.


Nested conditions

Nested conditions require a different approach. Let's see how they work through an example.

Let's assume we want to filter users with “Admin” in the User Principal Name who are based in either France or Italy. 

We might be inclined to set the condition as shown in the screenshot below:

However, by setting the conditions as shown above, we will not yield the desired results.

In reality, it will display users who:

  • have “Admin” in their User Principal Name AND are based in France
  • or are based in Italy, regardless of their User Principal Name.

This occurs because the conditions are interpreted as follows:

CRITERION 1 AND CRITERION 2, OR CRITERION 3

Users with a UPN that contains 'Admin' AND are based in 'France', OR users based in 'Italy'

To correctly manage nested conditions, you must combine both criteria, prioritizing the Boolean operator that effectively handles the nested conditions. Refer to the updated configuration in the screenshot below:

By configuring the condition as indicated in the above screenshot, we ensure that both elements of the criteria are met, using the correct Boolean operator for nesting.

This configuration will display users who:

  • Have “Admin” in their User Principal Name (UPN) AND
  • Are based in either France OR Italy.

This is because the condition is now correctly interpreted as follows:

[CRITERION 1 AND CRITERION 2] OR [CRITERION 1 AND CRITERION 3]

[Users with a UPN that contains 'Admin' AND are based in 'France'] OR [Users with a UPN that contains 'Admin' AND are based in 'Italy']

This configuration ensures that only users with “Admin” in their UPN and located in either “France” or “Italy” will appear in the search results.