Microsoft Dynamics CRM - Query record
The Microsoft Dynamics CRM - Query record action A tool for building the processes, logic, and direction within workflows. Actions are the steps the workflow performs to complete a process. queries records of a specified entity in Microsoft Dynamics CRM, while limiting results by using conditional statements and sorting results as configured.
For example, in the Contact entity, you want to know the number of customers in a certain region. By using conditions, you can specify your query results such as: When Address 1: Country/ Region equals Singapore. You can then store the number of records returned in a variable.
For more information about Microsoft Dynamics CRM, go to Microsoft Dynamics CRM.
Configure the Microsoft Dynamics CRM - Query record 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.
-
Select the Entity name of the records you want to query.
-
Limit the returned query results (add one or more conditions):
- Click Add condition.
-
In the Condition section, complete the fields below.
Field
Description
When Attribute from the selected object. Accepts a selection from the drop-down list. Operator Comparison between When and Value. Accepts a selection from the drop-down list. Selections in the drop-down list correspond to the data type of the entry for When. Value The value you are looking for in the attribute specified for When. Accepts either a selection from the drop-down list or an inserted variable. Accepted variable types correspond to the data type of the entry for When. - Click Add condition to save your changes.
- To add another condition, click Add condition again.
- To configure query behavior for multiple conditions, select all or any.
-
Sort returned query results:
- For Sort by, select a value.
- Select a Direction.
Configure the storage of Microsoft Dynamics CRM - Query record outputs
After entering values for the required fields in Microsoft Dynamics CRM - Query record action, you have the option to store the following outputs as variables:
- Record IDs
- Number of records returned
-
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.
- Complete the required fields, as specified in Microsoft Dynamics CRM - Query record.
- In Store record IDs, select a variable that will store the value of the Record IDs.
- In Number of records returned, select a variable that will store the value on how many records will be returned from the query.
Microsoft Dynamics CRM - Query record action fields, buttons, and settings
Section |
Field |
Description |
Variable types |
||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
The Microsoft Dynamics CRM connection to use for accessing the records to query. |
(n/a) |
|||||||||
|
Entity name |
The entity of the records you want to query. Accepts a selection from the drop-down list. Options in the drop-down list are derived from the selected Microsoft Dynamics CRM connection. |
(n/a) |
||||||||
Condition |
|
Conditional statements to use for the query. For example, to query for stale items, you might configure a condition "Modified is before <yourDateVariable>."
Condition fields
|
(varies) |
||||||||
Sorting |
Sort by |
Attribute to use for sorting. Accepts a selection from the drop-down list. Options in the drop-down list are derived from the selected Microsoft Dynamics CRM connection. |
(n/a) |
||||||||
|
Direction |
Option to sort in Ascending or Descending direction. |
(n/a) |
||||||||
|
Store record IDs |
Variable to store IDs of records in the returned query results. |
Collection |
||||||||
|
Number of records returned |
Variable to store the quantity of records returned by the query. |
Integer |