Salesforce Integration with Nodejs based applications using Canvas

Salesforce Canvas Integration

Salesforce provides many ways to integrate with external systems like SOAP, Rest, Bulk API, User Interface API and so on. One of useful way to integrate any existing web applications with Salesforce is using Canvas.

For sake of this post, I’m using Nodejs application and complete source code can be found here , on my Github repository. It can be deployed on Heroku easily, however I used my local computer to run canvas. That also proves point that integration is happening via Browser and therefore canvas application can be hosted on premise and not necessarily on DMZ layer.

Step 1 : Create Connected App in Salesforce

Enable OAuth in Connected app and provide any Callback URL. Canvas app does not use callback URL however we DO NEED scope.

Next step would be enabling canvas app itself connected app along with locations where we would be using it.

Mulesoft 4 Transformation – Convert JSON to XML

We will start creating Mule Project in Anypoint studio and input would be provided by Http Listener.

Make sure MIME type of Http Listener set to application/json, otherwise we will get below error :

Dataweave Error: You called the function ‘Value Selector’ with these arguments …

Mulesoft Project structure below

Mulesoft Project – Convert JSON to XML

Introduction to Mulesoft with Example – Alpharetta Developer Group Meet

Last week, we organized Salesforce Developer group meet in Alpharetta and topic was Introduction to Mulesoft & Live Demo.

We covered,

If you don’t want to miss fun and learning sessions like these, make sure to join our Salesforce developer group here.

Below is slide from group meet

Use pipe delimited file to upsert record in Mulesoft 3

Upsert record in Salesforce using Mulesoft

Processing Comma Separated file is out of box but what if text file is delimited using comma.

In this post, we will read Pipe delimited file and upsert record in Salesforce. Instead of upserting record in Salesforce, you can do anything else you want to.

This is how final job will look like :