Azure Active Directory - Query users
Note: Microsoft has changed the name of Azure Active Directory to Microsoft Entra ID. However, Nintex Workflow and the help still refer to this product as Azure Active Directory.
Use the Azure Active Directory - Query users action A tool for building the processes, logic, and direction within workflows. Actions are the steps the workflow performs to complete a process. if you want to search for employees listed in your organization's directory based on conditions you specify. The output of the of this action can be stored in variables inside an object.
For example, your organization's Azure Active Directory contains a list of 500 employees and you want to get the email address of only 150 Belgium-based employees. To achieve this, you can:
- Specify 150 as the maximum number of users to return.
- Create a condition such as: When : Country or region equals "Belgium".
- Add an object variable to store the email address of each user in a variable, and use this variable in a Get item from collection action later in your workflow.
If in reality the directory listed only 87 employees located in Belgium, then the query results will give you only 87 names. This action stores the result in an object that stores the number of users returned in a variable.
For more information about Azure Active Directory, go to Azure Active Directory.
Configure the Azure Active Directory - Query users action
-
Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.
- Select a Connection. If you do not have a connection, see Add a connection.
- Type the Maximum number of users to return.
For example, a large-sized directory could contain about 500 employees. If you want the result to include only 150, type "150". To know the actual number of users returned by your query, see Configure the storage of the additional outputs of Azure Active Directory - Query users action.
Configure the storage of the additional outputs of Azure Active Directory - Query users action
- Add and configure the Azure Active Directory - Query users action.
- In Result create an Object variable to store the result of the action. The object stores the Number of users returned in a variable.
This variable is very useful especially if your workflow should know how many values were retrieved by the action.
Caution: The actual value stored in this variable depends on the results of the query but can be limited by setting the Maximum number of users to return. For example, a large-sized directory contains 500 names of employees located in various countries. You want to search for 150 Belgium-based employees. If in reality, the directory lists 87 employees located in Belgium, then results of your query will give you only 87 names. If this number is a crucial information in your workflow, you can store this number in a variable for use later.
-
The object you created to store the result in step 2, stores the email addresses of the users in the Store user emails collection variable.
To get each value stored in a collection, use the Get item from collection action.

A collection is an index-based array of values of different data types (text, integer, date/time, etc.) In Nintex Workflow, a collection is specifically designed to hold multiple values for safe keeping under one variable. Depending on how many values should be stored, the size of the collection is shaped accordingly to accommodate each value.
For example, your workflow retrieved a set of values such as Apple, 345, Kensas, and John@email.com. How would you store this random information in one place? That's where a collection comes in.
To get each value stored in a collection, use Get item from collection.
Azure Active Directory - Query Users action fields, buttons, and settings
Section |
Field |
Description |
Variable types |
---|---|---|---|
(unlabeled) |
The Azure Active Directory connection to use for querying users. |
(n/a) |
|
Maximum number of users to return |
The maximum number of users to be returned. This field accepts numbers between 1 and 999. |
Integer | |
Conditions | Add conditions/Edit conditions |
Conditional statements to use for the query. For example, to search for employees located in Belgium, you can write a condition such as When "Country or region" equals "Belgium". Displays the condition builder to define new conditions or edit existing conditions.
The Condition builder supports nested conditions, enabling you to create conditions within another condition. |
(n/a) |
Condition builder |
For fields and settings, see Condition builder. |
||
Output | Result |
Stores the output of the action in an object that has multiple variables. You can use these variables later in your workflow. Includes the following variables:
![]() A collection is an index-based array of values of different data types (text, integer, date/time, etc.) In Nintex Workflow, a collection is specifically designed to hold multiple values for safe keeping under one variable. Depending on how many values should be stored, the size of the collection is shaped accordingly to accommodate each value. For example, your workflow retrieved a set of values such as Apple, 345, Kensas, and John@email.com. How would you store this random information in one place? That's where a collection comes in. To get each value stored in a collection, use Get item from collection. |
Object |