Virtual Tenants are not available in the Essentials and Professional solutions.
This guide explains how to use Boolean operators (AND, OR) in Virtual Tenant filters, with a focus on managing nested conditions.
Boolean operators
AND
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/15740/3863621/1709116344436-virtual-tenants-filters-and-2.jpg)
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
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/15740/3863624/1709116344440-virtual-tenants-filters-nested-correct-2.jpg)
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:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/15740/3863623/1709116344443-virtual-tenants-filters-nested-wrong-2.jpg)
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:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/15740/3863566/1709114544639-virtual-tenants-filters-nested-correct.jpg)
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.