Dynamics 365 action failed – Error when trying to interact with Dynamics 365 through a flow

Loading

Power Automate integrates with Dynamics 365 to automate processes like creating leads, updating records, sending notifications, and retrieving data. However, Dynamics 365 actions may fail due to:

Authentication or permission issues
Incorrect entity or field mappings
API limits and throttling
Invalid data formats
Missing required fields

This guide covers:
🔹 Common causes of Dynamics 365 action failures
🔹 Step-by-step solutions for each issue
🔹 Best practices to prevent future errors


Step 1: Identifying the Dynamics 365 Action Failure

1.1. Check the Flow Run History

  1. Open Power Automate → Go to My Flows.
  2. Select the failing flow → Open Run History.
  3. Find the failed Dynamics 365 action and check the error message.

Step 2: Fixing Common Dynamics 365 Action Failures

2.1. Authentication or Permission Issues

Problem: Power Automate is unable to authenticate with Dynamics 365 due to expired credentials or missing permissions.

Solution:

  • Reconnect the Dynamics 365 connector:
    1. Go to DataConnections.
    2. Locate Dynamics 365 → Click Reconnect.
  • Ensure the user has the correct security roles in Dynamics 365:
    • System Administrator → Full access to all entities.
    • System Customizer → Can modify records but with restrictions.
    • Basic Roles (Salesperson, Service Rep, etc.) → Limited access.
  • To grant permissions:
    1. Go to Dynamics 365 Admin Center.
    2. Navigate to Security Roles → Assign necessary roles to the user.

Tip: Use a service account with necessary permissions to avoid authentication issues.


2.2. Incorrect Entity or Field Name

Problem: The flow is referencing a Dynamics 365 entity or field that does not exist or is misspelled.

Solution:

  • Verify that the entity (table) name is correct:
    1. Open Dynamics 365Advanced Find.
    2. Locate the correct table (entity) name.
  • Ensure field names match exactly as they appear in Dynamics 365.
  • Use internal names for fields instead of display names.

Example:

  • Display Name: “Customer Name”
  • Internal Name: “customername” (use this in Power Automate)

2.3. API Limits or Throttling

Problem: The flow sends too many requests to Dynamics 365 within a short time, causing API limits to be exceeded.

Solution:

  • Reduce frequent calls to Dynamics 365 by batching requests.
  • Add a delay between actions using the “Delay” action in Power Automate.
  • If heavy API usage is needed, consider increasing API capacity by upgrading your Dynamics 365 licensing plan.

Tip: Monitor API usage in the Power Platform Admin Center.


2.4. Required Fields Are Missing

Problem: A Dynamics 365 action fails because a required field is not provided in the flow.

Solution:

  • Check the required fields for the specific entity in Dynamics 365:
    1. Open Dynamics 365 → Navigate to the entity.
    2. Identify required fields (marked with a red asterisk).
  • Ensure these required fields are included in the flow’s action.

🔹 Example Fix:
If creating a new Lead, required fields like First Name, Last Name, and Topic must be provided.


2.5. Data Formatting Issues

Problem: Power Automate sends data in an incorrect format, causing Dynamics 365 to reject it.

Solution:

  • Ensure dates are formatted correctly using the formatDateTime() function: formatDateTime(utcNow(), 'yyyy-MM-ddTHH:mm:ssZ')
  • Use GUIDs for lookup fields (e.g., Account or Contact references) instead of names.
  • Convert number fields to numeric values before sending to Dynamics 365.

Example Fix:
If updating an Opportunity’s Estimated Revenue, ensure the value is a numeric type (e.g., 10000 instead of "Ten thousand").


2.6. Lookup Field Issues (Related Records Not Found)

Problem: The flow fails when trying to update a lookup field (e.g., assigning an Account to a Contact) because the related record does not exist or is referenced incorrectly.

Solution:

  • Use GUIDs (Unique Record IDs) instead of names for lookup fields.
  • Retrieve the related record first, then use its ID for lookup.

Example Fix: Assigning an Account to a Contact:
Instead of using:

Account Name: "ABC Corp"

Use the Account ID (GUID):

/accountid(Account ID)

2.7. Flow Exceeds Execution Limits

Problem: The flow runs for too long, exceeding Dynamics 365 execution time limits.

Solution:

  • Optimize the flow by removing unnecessary actions.
  • Use batch operations instead of processing items one by one.
  • Reduce nested loops to avoid excessive iterations.

Tip: If handling large datasets, consider using Power Automate’s “Pagination” settings to retrieve data in chunks.


Step 3: Preventing Future Dynamics 365 Action Failures

3.1. Use a Dedicated Service Account

  • Avoid using personal accounts for authentication.
  • Use a dedicated service account with minimum required permissions.

3.2. Monitor API Usage and Optimize Requests

  • Check API consumption in Power Platform Admin Center.
  • Use bulk operations instead of individual updates to avoid API throttling.

3.3. Validate Inputs Before Sending to Dynamics 365

  • Use “Condition” actions to verify that all required fields are populated.

3.4. Implement Error Handling with “Run After” Conditions

  • Configure Power Automate to retry failed actions in case of temporary failures.
  • Use “Scope” actions to group related steps and handle failures gracefully.

3.5. Enable Power Automate Logs and Alerts

  • Set up alerts for recurring failures.
  • Regularly review Power Automate run history to identify patterns in failures.

Leave a Reply

Your email address will not be published. Required fields are marked *