For the complete documentation index, see llms.txt. This page is also available as Markdown.

Salesforce

Connection

When you're setting up your first workflow with Salesforce, you will need to create a Connection in order to connect MESA with Salesforce.

Screenshot of the MESA Salesforce step Connection menu where you create a new Connection to link MESA with Salesforce. Spotlight the Connection setup area.
1

Log in to Salesforce, then click the Setup button (gear icon in the top right). If a menu is displayed, then click Setup.

Screenshot of Salesforce after logging in, click the Setup button in the top right. Spotlight the Setup gear icon in the top right.
2

In the left-hand menu, navigate to Apps and App Manager.

Screenshot of the Salesforce Setup left-hand menu, navigate to Apps then App Manager. Spotlight the App Manager menu item.
3

Then click on New External Client App.

Screenshot of the Salesforce App Manager page. Spotlight the New External Client App button.
4

Enter MESA for the External Client App Name. The API Name field will then auto-populate.

5

Enter a valid email for Contact Email.

6

Ensure Enable OAuth Settings is checked in the API (Enable OAuth Settings) menu.

8

Then select all items under Available OAuth Scopes and hit the right arrow under Add to move all of them to Selected OAuth Scopes.

At the very least, Manage user data via APIs (api) and Perform requests at any time (refresh_token, offline_access) must be added as Selected OAuth Scopes.

9

By default, 3 settings will be selected automatically. Ensure that only the Require Secret for Web Server Flow and Introspect All Tokens checkboxes are selected from the list.

10

Then hit the Create button at the bottom.

11

Once you are redirected back to view the app's details, click on Policies under your app's name.

12

Under OAuth Policies, ensure that your Refresh Token Validity Period is set to 30 days.

13

Once you have checked your app policy settings, click Settings under your app name.

14

In the OAuth Settings menu, click on the App Settings Consumer Key and Secret button. You may get prompted to sign in again so please do so.

15

For this next step, you are going to copy and paste these values from the Salesforce screen into your MESA workflow. In a new tab on your browser, open your Salesforce Trigger or Action to proceed.

16

In Salesforce, click on the Consumer Key button and paste the copied value into the Client ID field of your MESA Salesforce step's Connection menu.

17

Do the same for Salesforce's Consumer Secret and paste it into the "Client Secret" field of your MESA Salesforce step's Connection menu.

18

For MESA's Authorization URL field, enter: https://login.salesforce.com/services/oauth2/authorize

19

For MESA's Token URL field, enter: https://login.salesforce.com/services/oauth2/token

If you are connecting to a Salesforce sandbox, you will need to: - Replace the Authorization URL with: https://test.salesforce.com/services/oauth2/authorize - Replace the Token URL with: https://test.salesforce.com/services/oauth2/token

20

Click Sign in with Salesforce. You may be asked to login to your Salesforce account. Once logged on, you will get a prompt asking for access. Click Allow.

Screenshot of the MESA Salesforce Connection menu, clicking Sign in with Salesforce and then Allow access. Spotlight the Sign in with Salesforce button.
21

You will be taken back to MESA, with a new Salesforce connection created.

You have now finished setting up your Salesforce connection. Click the Retrieve Fields button to import your fields.

Salesforce plans that support API access are: Enterprise, Unlimited, Developer and Performance.

Configure

Retrieve Fields

Click the Retrieve Fields button to pull in the current fields associated with your Salesforce action.

If you’ve made updates to your fields in Salesforce you will want to click the Retrieve Fields button to pull in the latest changes.

Technical Notes

Why can't I set the amount on an opportunity?

  • If an opportunity includes products, the amount on the opportunity will be the total of its related products. For more information, please refer to this Salesforce article.

Connection error codes

  • If you experience any issues or see this error error=invalid_client_id&error_description=client%20identifier%20invalid when creating a Salesforce connection, please make sure that your Salesforce Client ID and Secret were copied over correctly and that your Salesforce App has the correct Callback URL.

  • If you experience any issues or see this error error=redirect_url_mismatch&error_description=redirect_url&20must%20match%20configuration when creating a Salesforce connection, please make sure you have added the Callback URL in the External Client app while creating it in Salesforce.

  • If you experience any issues or see this error error=unknown_error_description=retry_your_request when creating a Salesforce connection via Sandbox, the External Client App's Permitted Users OAuth policy is likely set to "Admin approved users are pre-authorized", and as the connecting user, you aren't assigned to the app.

    • Salesforce refuses at the consent step and redirects back to MESA's callback with error=OAUTH_APP_ACCESS_DENIED and no authorization code.

      • To fix this, you should go to Setup in the sandbox → External Client App Manager → your app → Policies → Edit → OAuth Policies:

        • set Permitted Users to "All users may self-authorize", or

        • keep pre-approval and assign your user Profile (Connected App Access) or a Permission Set (Assigned Connected App) to the app.

Specify the API User in the External Client App

  • To specify the API User in an External Client App, you will need to configure your Salesforce connected app accordingly by following this Salesforce thread: https://salesforce.stackexchange.com/a/431770

    • You will also need to ensure the app has the refresh_token and offline_access enabled

View Salesforce templates and tutorials here!

Last updated