Salesforce action failed – Issues with Salesforce integration in a flow.

Loading

Power Automate enables integration with Salesforce to automate tasks like record creation, updates, and data retrieval. However, errors can occur when interacting with Salesforce, preventing the flow from executing successfully.

This guide will cover:
Common causes of Salesforce action failures
Step-by-step troubleshooting solutions
Best practices for reliable Salesforce integration


Step 1: Identify the Salesforce Error

1.1. Check Power Automate Flow Run History

  1. Open Power AutomateMy Flows.
  2. Click on the failing flow → Go to Run History.
  3. Locate the Salesforce action and check the error message.

Common Salesforce error messages:

  • “Authentication failed”
  • “Insufficient permissions”
  • “API limit exceeded”
  • “Invalid record ID”
  • “Object not found”
  • “SOQL query syntax error”

Step 2: Fixing Common Salesforce Action Errors

2.1. Invalid or Expired Salesforce Connection

Problem: The Power Automate connection to Salesforce is invalid or expired.

Solution:

  • Go to Power Automate → Data → Connections.
  • Locate Salesforce and check if the status is “Invalid”.
  • Click Fix Connection or Re-authenticate with valid Salesforce credentials.
  • If using OAuth authentication, ensure the token is still active.

Tip: Salesforce sessions expire periodically. Consider extending token expiration settings in Salesforce.


2.2. Insufficient User Permissions in Salesforce

Problem: The Power Automate user does not have the required permissions to access Salesforce data.

Solution:

  1. In Salesforce, go to Setup → Users → Profiles.
  2. Ensure the user has the correct permissions for objects, fields, and API access.
  3. Assign the user the API Enabled and Modify All Data permissions if necessary.

Tip: If accessing custom objects, ensure the user has read/write permissions on them.


2.3. Invalid Salesforce Record ID

Problem: The flow is trying to update or retrieve a nonexistent or incorrectly formatted record ID.

Solution:

  • Ensure the record ID is in the correct format (e.g., 18-character ID, not 15-character).
  • Use a “Get Record” action before updating a record to verify it exists.
  • If using dynamic content, confirm the value matches the expected ID format.

Tip: Convert 15-character IDs to 18-character format using Salesforce’s CASESAFEID() function.


2.4. Salesforce Object Not Found

Problem: The flow is trying to access a Salesforce object that doesn’t exist.

Solution:

  • In Salesforce Setup → Object Manager, check if the object exists.
  • If using a custom object, confirm that its API name is correct (e.g., CustomObject__c).
  • If referencing an object dynamically, ensure the value is being passed correctly.

Tip: Always use the Salesforce API name, which may be different from the display name.


2.5. SOQL Query Syntax Error

Problem: The SOQL query used in the flow is incorrectly formatted.

Solution:

  • Use Salesforce Developer Console to test and debug SOQL queries.
  • Ensure field names and object names are spelled correctly.
  • If using filters, ensure they follow correct SOQL syntax: SELECT Id, Name FROM Account WHERE Name = 'Acme Corp'
  • Avoid reserved keywords without escaping them.

Tip: If using date filters, ensure the format matches Salesforce’s YYYY-MM-DDTHH:MM:SSZ standard.


2.6. API Call Limit Exceeded

Problem: The flow has made too many API requests to Salesforce in a short period.

Solution:

  • Reduce the number of Salesforce actions per flow execution.
  • Use batch operations instead of individual requests.
  • Add a “Delay” action between Salesforce calls to distribute requests.
  • Check API limits in Salesforce Setup → Company Information.

Tip: Consider upgrading your Salesforce plan if you frequently hit API limits.


2.7. Flow Trying to Create a Duplicate Record

Problem: The flow is attempting to create a record that already exists, violating duplicate rules.

Solution:

  • Before creating a record, use “List Records” to check if it already exists.
  • Enable “Upsert” instead of “Create Record” to update existing records instead of creating duplicates.
  • Review Salesforce duplicate rules in Setup → Duplicate Management.

Tip: Use External IDs to prevent duplicate records during data integration.


2.8. Field-Level Validation Rules Blocking the Flow

Problem: Salesforce validation rules prevent record creation or updates.

Solution:

  • In Salesforce Setup → Object Manager → Validation Rules, check for rules that may be blocking the update.
  • Adjust the flow’s input values to meet validation rule criteria.
  • If needed, disable the validation rule temporarily to test the flow.

Tip: Use debugging messages in Power Automate to see which field is causing the issue.


2.9. Flow Not Triggering Due to Record Changes

Problem: The Power Automate flow is not triggering when a Salesforce record changes.

Solution:

  • Ensure Change Data Capture (CDC) is enabled for the relevant objects.
  • Use a Polling Interval in Power Automate to check for new records.
  • If using Platform Events, verify the event is being fired correctly.

Tip: Salesforce Enterprise & Unlimited editions have better real-time integration support.


Step 3: Preventing Future Salesforce Errors

3.1. Use a Dedicated Salesforce Integration User

  • Create a Salesforce API-only user for Power Automate.
  • Assign only necessary permissions to avoid security risks.

3.2. Implement Error Handling in Power Automate

  • Wrap Salesforce actions inside a “Scope” and configure retry settings.
  • Use “Run After” conditions to handle failures gracefully.

3.3. Optimize API Calls to Avoid Limits

  • Use batch operations for data processing.
  • Implement caching where possible.

3.4. Monitor Salesforce Integration Logs

  • Enable Field History Tracking to see changes in Salesforce records.
  • Set up alerts for API usage limits in Salesforce.

Leave a Reply

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