salesforce.md

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.

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

{% endstep %}

{% step %} In the left-hand menu, navigate to Apps and App Manager.

{% endstep %}

{% step %} Then click on New External Client App.

{% endstep %}

{% step %} Enter MESA for the External Client App Name. The API Name field will then auto-populate. {% endstep %}

{% step %} Enter a valid email for Contact Email.

{% endstep %}

{% step %} Ensure Enable OAuth Settings is checked in the API (Enable OAuth Settings) menu.

{% endstep %}

{% step %} Then for Callback URL, enter: https://app.getmesa.com/apps/mesa/oauth/redirect-token

{% endstep %}

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

!

{% hint style="info" %} 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. {% endhint %} {% endstep %}

{% step %} 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.

{% endstep %}

{% step %} Then hit the Create button at the bottom.

{% endstep %}

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

{% endstep %}

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

!

{% endstep %}

{% step %} Once you have checked your app policy settings, click Settings under your app name.

{% endstep %}

{% step %} 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.

{% endstep %}

{% step %} 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. {% endstep %}

{% step %} 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.

{% endstep %}

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

!

{% endstep %}

{% step %} For MESA's Authorization URL field, enter: https://login.salesforce.com/services/oauth2/authorize {% endstep %}

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

{% hint style="info" %} 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 {% endhint %} {% endstep %}

{% step %} 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.

{% endstep %}

{% step %} 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. {% endstep %} {% endstepper %}

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?

Connection error codes

{% hint style="info" %} View Salesforce templates and tutorials here! {% endhint %}