Salesforce

Connect Salesforce with MESA

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

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

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

3. Then click on New Connected App.

4. Enter a name for the connected app under Connected 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.

7. Then for Callback URL, enter: https://app.getmesa.com/apps/mesa/oauth/redirect-token

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.

9. By default, 3 settings will be selected automatically. Please make sure to unselect  Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows and Require Secret for Refresh Token Flow.

10. Then, select Introspect All Tokens. Your settings should match the below screenshot.

11. Then hit the Save button at the top.

🗒 Note: After saving, you may then see a warning that changes can take up to 10 minutes to take effect.

12. Click on Continue as well.

13. Once you are redirected back to view the app's details, click on Manage at the top of the page.

14. Click on Edit Policies next to your app's name.

15. Under oAuth Policies, please ensure that your Refresh Token Policy is set to: Refresh token is valid until revoked

16. Once you have checked your app policy settings, navigate to Apps and App Manager again. Click on the arrow on the right hand side to View your app.

17. Under API (Enable OAuth Settings), click on the Manage Consumer Details button next to Consume Key and Secret. You may get prompted to sign in again so please do so.

18. 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.

19. In Salesforce, click on the Consumer Key button and paste the copied values into MESA's Salesforce's Client ID field.

20. Do the same for Salesforce's Consumer Secret and paste it into MESA's Salesforce Client Secret field.

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

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

🗒 Note: 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

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

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

You have now finished setting up your Salesforce credential. From now on, as long as you are connecting to the same Salesforce account, you can just reuse the same one. Great work 🎉

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

Configuration

Synchronize your Salesforce fields

MESA allows you to pull down the fields from your Salesforce account, for a selected resource, such as Account. Once you have set up or selected a valid credential for a trigger or action, click the Retrieve Fields button.

This will retrieve all editable fields and make them available when creating or updating a resource, and also as variables in subsequent actions - for example Email.

Within Salesforce, if you edit the fields on a resource, you can then click Retrieve Fields on your Salesforce trigger or action to get a refreshed list. Any existing fields which have values assigned to them will be preserved.

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

If an opportunity has products, then the amount on an opportunity is the sum of its related products. Please see this Salesforce article for details.

Templates

For details on MESA's Salesforce templates, see the following documentation.

I don't see my Salesforce workflow activating when I update something in Salesforce?

MESA workflows that contain Salesforce triggers (such as Lead Created) will run on a polling system. Meaning, on every hour or whatever the selected frequency is selected in your MESA workflow, MESA will look for any recent activity in Salesforce. As a result, you may not see immediate activity in your MESA workflow until the frequency hits.

In Salesforce triggers, you can find the polling system under the Advanced Options. You can keep the default frequency or adjust it.

Once the frequency hits, MESA will process every single task that has accrued within the previous timeframe.

🗒 Note: Please note that available frequencies will differ depending on your MESA billing plan.