Summary: ◀▼
You can connect action flows to Microsoft Dynamics 365 Sales to automate tasks like searching, creating, and updating leads, cases, contacts, and accounts. Use a dedicated service account for secure OAuth 2.0 authentication. This integration helps manage CRM data within workflows, improving data accuracy and collaboration across platforms without manual entry.
Connecting Microsoft Dynamics 365 Sales to action builder
Before you can include external actions in your action flows, you must connect the action builder to the external system.
- All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it's a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
- All integrations request access to necessary scopes. However, it's important that you review and validate the scopes before authorizing the connection to the external system.
- When managing credentials for API key-based tools, such as OpenAI, it's best to store keys in a secure vault or credential manager.
- In Admin Center, click
Apps and integrations in the sidebar, then select Actions > Action
flows. - Create or edit an action flow.
- Open the step sidebar.
- Under External actions, click Microsoft Dynamics 365 Sales.
- Click Connect.
- Follow Microsoft Dynamics 365 Sales's prompts to authenticate and complete
the connection.
The Microsoft Dynamics 365 Sales connection uses OAuth 2.0 authentication to securely access your Dynamics 365 CRM instance. You'll be redirected to Microsoft Dynamics 365 Sales to authorize access to your account.
You must provide your Dynamics 365 Sales domain during setup. If your Dynamics 365 Sales URL is
https://abc.crm.dynamics.com, enterabc.crm.dynamics.comas the domain.Note: All external actions performed by an action flow are attributed to the user who connected the external system. Therefore, it is a best practice to use a dedicated service account rather than personal credentials when connecting to each external system.
After you've connected to the system, you'll see an indicator that it's connected and details about the instance you're connected to, as well as the actions available for Microsoft Dynamics 365 Sales.
Using Microsoft Dynamics 365 Sales actions in action flows
Searching for leads
Use the Search leads action to find existing leads for deduplication or enrichment.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Optional: Email,
Subject, Company name,
PhoneEmail and Phone perform exact matches. Subject and Company name perform partial matches (contains). Use this action before creating a lead to check for duplicates. |
| Output | Array of leads with lead ID, subject, name details, contact information, company details, lead quality and source codes, state and status codes, owner ID, and timestamps. |
Creating a lead
Use the Create lead action to create a new sales lead in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: SubjectSubject is the lead title or topic with a maximum of 200 characters. Optional: Lead quality options include values defined in your Dynamics 365 configuration. |
| Output | Lead details including lead ID, subject, full name, email, company name, state and status codes, creation time, and owner ID. |
Updating a lead
Use the Update lead action to modify an existing lead in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Lead IDLead ID must be the GUID of the lead to update. Optional:
State options include values defined in your Dynamics 365 configuration. Only provided fields will be updated. |
| Output | Lead details including lead ID, subject, state code, status code, and modification timestamp. |
Searching for cases
Use the Search cases action to find existing cases for deduplication or tracking.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Optional: Title, Case
number, Customer ID,
StateCase number and Customer ID perform exact matches. Title performs a partial match (contains). Use State dropdown to filter by case status. |
| Output | Array of cases with incident ID, case number, title, description, customer ID, origin and type codes, state and status codes, priority, owner ID, and timestamps. |
Creating a case
Use the Create case action to create a new support case in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: TitleTitle has a maximum of 200 characters. Optional:
Provide either Contact or Account to associate the case with a customer. Contact and Account are populated from dynamic dropdowns of your CRM data. |
| Output | Case details including incident ID, title, case number, state and status codes, and creation time. |
Updating a case
Use the Update case action to modify an existing case in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Case numberCase number format is typically CAS-01003-XXXXXX. Optional:
Status code depends on the selected state. Only provided fields will be updated. |
| Output | Case details including incident ID, title, case number, state and status codes, and modification timestamp. |
Searching for contacts
Use the Search contacts action to find and enrich contact data. Use this action to check for existing contacts before creating new ones.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Optional: Email, First
name, Last name,
PhoneEmail and Phone perform exact matches. First name and Last name perform partial matches (contains). |
| Output | Array of contacts with contact ID, name details, contact information, job title, department, address, birth date, description, parent customer ID, owner ID, and timestamps. |
Creating a contact
Use the Create contact action to create a new contact record in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Last nameOptional:
Parent account ID links the contact to an existing account. Provide the GUID of the account to establish this relationship. |
| Output | Contact details including contact ID, full name, first and last names, email, and creation time. |
Updating a contact
Use the Update contact action to modify an existing contact in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Contact IDContact ID must be the GUID of the contact to update. Optional:
Only the fields you provide will be updated. Existing values for fields you don't specify will remain unchanged. |
| Output | Contact details including contact ID, full name, first and last names, email, and modification timestamp. |
Searching for accounts
Use the Search accounts action to find and enrich account data. Use this action to check for existing accounts before creating new ones.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Email and Phone perform exact matches. Account name and Website perform partial matches (contains). |
| Output | Array of accounts with account ID, name, contact information, website, full address details, description, employee count, revenue, industry code, owner ID, and timestamps. |
Creating an account
Use the Create account action to create a new organization account in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Account nameAccount name has a maximum of 160 characters. Optional:
Website has a maximum of 200 characters. Use the address fields to store the organization's primary location. |
| Output | Account details including account ID, name, email, and creation time. |
Updating an account
Use the Update account action to modify an existing organization account in Dynamics 365 CRM.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs | Required: Account IDAccount ID must be the GUID of the account to update. Optional:
Only the fields you provide will be updated. Existing values for fields you don't specify will remain unchanged. |
| Output | Account details including account ID, name, email, and modification timestamp. |
Looking up a user
Use the Lookup user action to find a user by ID or email address.
This action has the following inputs and outputs:
| Variables | |
|---|---|
| Inputs |
Optional: Provide either User ID or Email to look up a user. If both are provided, User ID takes precedence. |
| Output | User details including ID, email, firstName, and lastName. |