Get Records
Use the Get Records action to fetch records of an entity type.
Complete the following steps to use the Get Records action in your workflow:
1. Drag the Get Records action under Dynamics 365 CRM to the canvas, place the pointer on the action, and then click or double-click the action. The Get Records window opens.
2. Edit the Label, if needed. By default, the label name is the same as the action name.
3. To add a Dynamics 365 CRM connector type, refer to Supported Dynamics 365 CRM Connector Types.
If you previously added a connector type, select the appropriate Connector Type, and under Connector Name, select the connector.
4. Click TEST to validate the connector.
5. Click MAP CONNECTOR to execute the action using a connector that is different from the one that you are using to populate the input fields. In the Runtime Connector field, provide a valid Dynamics 365 CRM connector name. For more information about MAP CONNECTOR, see Using Map Connector.
6. In the Find By list, select one of the following:
Selection—Choose Selection to provide inputs for individual fields listed in the form.
Use Selection when the identifier for a specific entity type is available and can be provided to the action to fetch its details.
Query—Choose Query to specify a single query.
Use Query to apply additional filtering criteria on records.
If you chose Selection in the Find By list
a. In the Entity Set list, select an entity set.
b. In the Entity Identifiers field, provide a comma-separated list of entity identifiers.
* 
For an entity identifier with a single property, specify Property1Value1 or [Property1Value1].
For an entity identifier with multiple properties, specify [Property1Value1,Property2Value1,Property3Value1]
You must specify multiple property values in the same order as they are specified in the Service Metadata document.
For multiple identifiers with a single property, specify Property1Value1,Property1Value2,Property1Value3 or [Property1Value1],[Property1Value2],[Property1Value3]
For multiple identifiers with multiple properties, specify [Property1Value1,Property2Value1],[Property1Value2,Property2Value2]
You must specify multiple property values in the same order as they are specified in the Service Metadata document.
c. In the Query Type list, select one of the following options, and do the following:
Form-Based Query
a. Under Select Attributes, click Add, and in the Attribute list, select the property for which you want to retrieve values.
Click Add to add multiple attributes. Click to delete any attribute that you added.
Values for ‘key’ properties are also retrieved in the output.
b. Under Add Related Items, click Add, and in the Related Item list, select the related item for which you want to retrieve values.
Click Add to add multiple related items. Click to delete any related item that you added.
Any property marked as NavigationProperty is categorized as a Related Item.
Discrete Query
a. In the Select Attributes field, specify an OData select expression that provides a comma-separated list of property names.
Values for ‘key’ properties are also retrieved in the output.
b. In the Add Related Items field, specify an OData select expression that provides a comma-separated list of related items.
Any property marked as NavigationProperty is categorized as a Related Item.
Raw Query
In the Query field, specify an OData query expression.
$select=name,number&$expand=context&$top=2&$skip=1&$orderby=name asc&$filter=name eq 'PTC'
Values for ‘key’ properties are also retrieved in the output.
Any property marked as NavigationProperty is categorized as a Related Item.
OR
If you chose Query in the Find By list
a. In the Entity Set list, select an entity set.
b. In the Query Type list, select one of the following options, and do the following:
Form-Based Query
a. In the Join By list, select a logical operator that joins the filter clauses. The default value is and.
b. Click Add to add a filter:
Property—Select the property to search.
Condition—Select a condition. The condition depends on the type of the property selected such as String, Boolean, and so on.
Property Value—Enter a property value.
Click Add to add multiple filters. Click to delete any filter that you added.
c. Under Select Attributes, click Add, and in the Attribute list, select the property for which you want to retrieve values.
Click Add to add multiple attributes. Click to delete any attribute that you added.
Values for ‘key’ properties are also retrieved in the output.
d. Under Add Related Items, click Add, and in the Related Item list, select the related item for which you want to retrieve values.
Click Add to add multiple related items. Click to delete any related item that you added.
Any property marked as NavigationProperty is categorized as a Related Item.
e. Under the Order By group, select the Attribute and then the attribute Order in the result.
f. In the Limit field, enter a value to limit the output to a specified number of entities.
g. In the Skip field, enter the number of resources that you want to skip.
Discrete Query
a. In the Filters field, specify OData filter criteria in the propertyName operator 'value' [and | or | not]... format.
For example, number eq '0000222341' or name eq 'PTC' or startswith(name, 'PTC')
b. In the Select Attributes field, specify an OData select expression that provides a comma-separated list of property names.
Values for ‘key’ properties are also retrieved in the output.
c. In the Add Related Items field, specify an OData select expression that provides a comma-separated list of related items.
Any property marked as NavigationProperty is categorized as a Related Item.
d. In the Order By field, enter an OData orderBy expression in the propertyName [asc | desc] format.
e. In the Limit field, enter a value to limit the output to a specified number of entities.
f. In the Count list, select true to retrieve the number of records in the output; otherwise select false.
Raw Query
In the Query field, specify an OData query expression.
For example: $select=name,number&$expand=context&$top=2&$skip=1&$orderby=name asc&$filter=name eq 'PTC'
Values for ‘key’ properties are also retrieved in the output.
Any property marked as NavigationProperty is categorized as a Related Item.
Output schema
The Get Records action returns a dynamic output schema depending on the entity type that you select.
If you selected Form-Based Query to specify query parameters, the output schema provides details of the selected properties only.
For Discrete Query or Raw Query, the output schema contains all properties of the returned object; however it provides values of the selected properties only.
Was this helpful?