Saturday, 13 January 2018

Integration - Create a lead in CRM via a web service in 10 minutes

CRM (Microsoft Dynamics Online – not AX CRM) has an SDK which you could use to integrate to. It can been overwhelming sometimes. So, I decided to use Flow to do the communication for me (HTTP Request > Dynamics). Took me 10 minutes from start to finish.

I didn’t have to learn the CRM SDK or figure out how to do authentication etc. I wanted to send a simple json message like this.

     "Email": "",
     "FirstName": "Munib",
     "LastName": "Ahmed",
     "Topic": "Health"

Go to Flow and create a new HTTP request. Click on “Use sample payload to generate schema” and enter the above json message. It will generate a schema as per below screenshot. Take note of the HTTP POST URL that has been generated. We will use that later to send the message to.


In the Actions select Dynamics > “Create a new record”. Select Leads as the entity name. Map the fields and you are done.


Now we just need to send a message to Flow using the URL. It doesn’t matter what tool you use to send a message. Below I used AX2012 (just because I had this job from a previous blog post I did).


Go to Flow Run history to see what has happened. Notice in the output – it looks like the message we sent.


We see the same in the creation. The mapping has worked.


Final result in CRM is the lead created. All my mapped fields look fine.


A word of caution. This is not a production ready solution. As you should consider security and your end to end architecture.

I did this as a proof of concept and wanted to show the power of Flow. Allowing me to integrate to another system that I didn’t have much knowledge of.

No comments: