
For the purpose of this blogpost we are going to create a new SalesForce development environment. This is free. Then we are going to create a new Account in SalesForce, poll this account via a Microsoft Logic App and then transform the data and send it to a Web API. In our case a simple requestb.in to work as a HTTP endpoint.
Content
Browse to request.in a new HTTP endpoint is nog setup to which you can send HTTP requests.
First off create a new SalesForce development environment. You can skip this step of the course if you already have a salesforce environment which you will be using. Simply browse to the following site. https://developer.salesforce.com/signup . Fill out the form and a new environment will be set up in the cloud directly for you.
Okay so time to create a new account in SalesForce. Select Accounts >> New and fill out all the required fields.
As we will be transforming our data from format A to format B. It is important to know to which .xsd schema format A and B comply. So let’s start off with getting our input schema. By setting up the logic app below we can check which xml file we get from SalesForce. Notice how we used the workflow definition to parse the JSON SalesForce output to XML. Since the JSON output from the SalesForce component did not specify a root node I started by using the concat function to concatenate a root node onto the JSON output. Since Logic app’s use XSL as their transformation language it is important that our input and output types are always XML files.
So this provided us with an XML file which we then turned into the following xsd file.
The next step is developing our schema and mapping which we will be using to develop our logic app. For this blogpost I’ve created a simple schema as you can see below. It only has 2 fields per Account node. Name and ID.
Now that we have 2 schema’s we can map the incoming schema to the outgoing mapping. I’ve created the following simple XSL file to accomplish this.
Ok so now we need to create an Integration Account. This acts as a container for all you integration files (schema’s, transformations, partners and agreements.
Select Integration Account from the Store.
Fill out the required fields.
And then upload the 2 schema’s we created and the transformation .xslt file.
Now link the integration account to the logic app as shown below.
Now we can add the transformation
Conclusion
So what we have succesfully done now is used the Logic app’s SalesForce connector to get data from our Sales Accounts. At first, we created a small version of our logic app to see in which format SalesForce sent their data. We created a schema based on the file we received from SalesForce. After that we mapped this schema to our desired destination schema. We uploaded our schema’s and mapping onto our Integration account, which we configured for use with our logic app. We added a transformation shape and posted the data onto our request.in.