Skip to content

D365 Search Records

Description

The D365 Search Records node allows you to search for and retrieve multiple records from Microsoft Dynamics 365 / Dataverse based on specified filter criteria.
It can be used to query standard or custom entities and return matching records as structured data for use later in the workflow.

This node is useful for:

  • Retrieving lists of records that match certain conditions (e.g., all active accounts or contacts by region)
  • Performing lookups and iterating through results
  • Passing record lists to downstream nodes for processing, updates, or reporting

How to Use

When added to a workflow, this node presents a configuration form with the following input fields.

FieldTypeDescriptionRequiredVisible When
ServiceAccount - Microsoft Dynamics 365Service Account PickerSelect the Dynamics 365 service account that has permission to query records.Always
Entity TypeTextThe logical name of the entity to search (e.g., account, contact, lead, or your custom entity).Always
FilterKey/Value DictionaryKey/value pairs used as filter criteria for searching records.

Example:
{ "statecode": 0, "customertypecode": 1 }

All filter conditions are combined using AND logic.
Optional
ColumnsList of TextList of fields (columns) to return from each record. If left empty, default attributes are returned.

Example: ["name", "emailaddress1", "accountnumber"]
Optional
Max PagesText (Number)The maximum number of pages to retrieve from the Dataverse API (default: 100). Each page typically contains up to 5000 records.Optional

Behavior

  • If no filter is provided, all records in the specified entity are retrieved (up to the maximum page limit).
  • If filters are provided, only records matching all key/value conditions are returned.
  • The output is a list of record dictionaries, each containing field names and values.
  • The Record Count output shows how many records were found.

Example Configurations

Example 1 – Search for Active Accounts

SettingExample Value
ServiceAccount - Microsoft Dynamics 365DynamicsProdService
Entity Typeaccount
Filter{ "statecode": 0 }
Columns["name", "accountnumber", "emailaddress1"]
Max Pages5

Result:
Retrieves all active accounts (where statecode = 0), returning up to 5 pages of results with name, account number, and email fields.


Example 2 – Search Contacts by City

SettingExample Value
ServiceAccount - Microsoft Dynamics 365DynamicsProdService
Entity Typecontact
Filter{ "address1_city": "Melbourne" }
Columns["firstname", "lastname", "emailaddress1"]

Result:
Returns a list of all contacts located in Melbourne, including their names and email addresses.


Outputs

After execution, the node produces the following output variables.

Output VariableTypeDescription
RecordsList of ObjectsArray of record objects, each containing key/value pairs for the requested fields.
Record CountNumberTotal number of records found.
Entity TypeTextThe entity type that was queried.

Example Output

json
{
  "Records": [
    {
      "name": "Tentech Pty Ltd",
      "accountnumber": "A1001",
      "emailaddress1": "info@tentech.com"
    },
    {
      "name": "MinuteView",
      "accountnumber": "A1002",
      "emailaddress1": "support@minuteview.com"
    }
  ],
  "Record Count": 2,
  "Entity Type": "account"
}

Example Workflow Usage

  1. Use D365 Search Records to find all relevant records (e.g., active accounts).
  2. Pass the Records output into a Loop Collection node to iterate over each record.
  3. Inside the loop, use D365 Update Record or D365 Execute Action to modify or trigger actions on each record.
  4. Optionally log or export the results for auditing or reporting.

Status Messages

StatusDescription
CompletedRecords retrieved successfully.
FailSearch failed due to invalid configuration or connection issue.

Error Handling

If the node fails, it will stop execution with a Fail status. Common error causes include:

  • Missing or invalid Dynamics 365 service account
  • Incorrect entity name
  • Invalid column names or filter fields
  • Service account lacking permission to read the entity
  • API rate limit or timeout (large datasets)

Notes

  • All field names must use the logical names as defined in Dynamics 365. For example, emailaddress1 instead of “Email Address”.
  • The Filter parameter only supports equals (=) conditions at this time.
  • The node returns up to the number of pages specified by Max Pages, each containing up to 5000 records per the Dataverse API limit.
  • The node uses the Dataverse REST API and respects user permissions and entity-level access rules.

Category: Integrations → Microsoft Dynamics 365 Task Name: D365SearchRecords

Tentech 2024