Connecting your first SaaS application to Salesforce

Connecting your first saas app
Jordan Schuetz
Jordan Schuetz
Developer Advocate
15 min read
Getting started

In this final guide, you will be leveraging work created from guides one, two and three of the quick start series to learn how to use Flow Designer to connect data from our API to Salesforce. Flow Designer is an easy to use tool to develop common integrations in a web-based interface. In this tutorial, we are going to use the HTTP Connector to GET in data from our API that we created in the previous tutorials, and automatically add each object as a new Salesforce Lead.

Step 1: Signup for Anypoint Platform

The first step is to Sign up for Anypoint Platform for free. Click the button below to create a free account.

After creating your account, go into Design Center, click the Create button at the top right, and then click Create new application.

create new application
Step 2: Build your flow

The first step to building our integration is to add an HTTP Connector as the trigger. When you open your project, select the option to go straight to the canvas. Click on the Trigger component, and select HTTP Listener and under path type /submit.

submit HTTP listener

Next, click the plus button, then search for the HTTP Request component. In the URL field, insert your unique URL for your API that you’ve deployed in the previous tutorials. You can find this URL in Runtime Manager. Once you have added the URL, click the to add the next component to your flow.

GET HTTP Request

Next, click the plus button again after your HTTP Request connector, and search for the Foreach connector. Add the connector to your flow, then click the X button again to add the next component to your flow.

ForEach

Lastly, search for the Salesforce Connector, and select the operation Create Single. When you create the configuration, click the Add connection button, name your Connection Name whatever you wish, and select Basic Username Password. Enter your Salesforce username and password and login, along with your security token. If you don’t have your security token in your inbox, login to Salesforce and go to Setup > Personal Setup > My Personal Information > Reset My Security Token. After all your credentials are entered, make sure you select Lead under Type, and under Record type: payload. Then click the Save button and test your application.

Flow
Step 3: Test your Salesforce integration

To test out your API and integration, grab the URL that is generated in the temporary environment and paste that into either the Mocking Service or Postman. Don’t forget to add /submit to the end of the URL, and then click the Send button to make the POST request to the endpoint.

enviorment

This execution should take around 30 seconds, and once it’s complete, you should see the complete JSON payload of 100 customer data entries returned in the response. When you log into Salesforce and navigate to New Leads, you should now see each entry added to Salesforce as a New Lead.

salesforce new lead

Amazing right? That’s it! You’ve built your very first integration using Flow Designer which grabs data from your API and inserts it into Salesforce as a new lead. To learn more about how to create more complex integrations, please visit our Developer Tutorials website.

Next, don’t forget to deploy your application! Go up to the top right, click the blue arrow, and select Deploy Application. For the environment, choose Sandbox and then lastly Deploy!

Nice work! If you want to learn more about MuleSoft's Anypoint Platform, check out our other developer tutorials or our developer certification training. Thanks for reading, your feedback is much appreciated. Please rate the tutorial below.

Try Anypoint Platform for free

Start free trial

Already have an account? Sign in.

Related tutorials