Integrating Dynamics 365 with other systems has always been an interesting topic and we have used different methods to achieve this, either solutions available in the market or custom development however since Microsoft has introduced Logic Apps, things have gone a bit crazy…I know we can’t achieve everything in Logic Apps like we can in custom development however we can do a lot, especially if we want to run asynchronously operations.
Let’s take an example, we have a requirement where we will receive a JSON from an other system and depending on the criteria set in our Logic App and data receieved in JSON we want to update external system and also update our Dynamics 365 too.
We could achieve above by writing custom code however will definitely take us some time for development, testing and on the top of that maintenance.
To get started, first thing we need to do is login to Azure portal and go to All Resources or search for Logic Apps in search and create a blank Logic App
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71a65876151.png)
Give your logic app a name and all other required details and create it.
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71a7ce1acff.png)
On next screen select Blank Logic App and then search for request (as below)
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71a85e2cbcb.png)
On next screen select ‘When a HTTP request is received’
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71a88f93e9d.png)
This will give us a unique Logic App URL and we can use it anywhere we need to call this Logic App
At this point we must have JSON we are going to receive so that we can update our logic app with, in this example I am going to use following JSON in Logic App{
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
Now click on ‘Use sample payload to generate schema’ and paste your JSON there and press on Done button
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71a99348ae6.png)
Then click on + New Step button, search for Http and select as below and then again HTTP
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71aa4603bdd.png)
You will see a screen as below
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71aa8482996.png)
We have selected above as we want to notify or update our third party or external system that we have received data or whatever the requirement is and therefore we have selected POST method
Uri is the url given to us by external or thirday party system (usually API)
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71ab628dd50.png)
In body, we have a sample JSON which third party or external system will accept to update their system and we are passing dynamic values from previous HTTP request (this is just a sample)
Until this point we have recieved data from third party or external system and update back third party or external system however we have not queried or updated Dynamics yet.
Next we want to get a contact where field abc is equal to data we recieved from step 1 i.e. http request
Search for Dynamics 365, select List Records, sign in to you D365 instance
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71acb1d9a13.png)
This will bring your org and list of entities, select your required entity you want to fetch with the required query. In this example we want to search where name is equal to one of the field from previous step. Make sure you have single quotes on both sides of value if its a string data
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71ad681714a.png)
At this point we have our contact from CRM which we want to update on Account entity, next step is to add a new action and search for Dynamics 365 and select Update a record action
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71adbd13b42.png)
As you can see in screenshot below, we want to update contact (from above step) on Account entity (find by external ref id from our JSON) – we will use Record identifier to find account record and then update contact on account
![](https://web.archive.org/web/20190226145056im_/https://365rack.com/wp-content/uploads/2018/08/img_5b71af9722524.png)
below is to update contact
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71b02eb8040.png)
Save your logic app and this will generate a URL which you can use to call this
![](https://365rack.com/wp-content/uploads/2020/06/img_5b71b09bb9225.png)