Logic Apps have made developers’s life easy

Posted on Posted in Azure, Logic Apps

If you are working in Dynamics 365 then most probably you have used or at least have heard about logic apps.

We had an urgent requirement where needed to read some data from a CSV file, then send it third party to update records on their system and then updated Dynamics 365

So in developer’s world, below is what we would need to do….

Develop an app, read data from csv, loop through each record, call third party api, send data, call dynamics, update data ……

So in above case, we are talking about at least 3-4 hours of work if you are comfortable with all coding bits……however we can achieve above with in 15 minutes using Logic App

Below is what we can do

Go to https://www.csvjson.com/csv2json and convert your csv into JSON data (as long as you have a record identifier in each row you want to use to update a record in third party or an other system

Create a new Logic App with HTTP trigger

Copy & paste JSON into following screen to generate schema

Create a new control of type for each

 

Add HTTP action and update details as needed including url, login etc.

Add JSON you need to send to third party API (sample below)

{
“Account”: {
“Create”: “true”,
“TableName”: “Account”,
“RecordID”: “@{items(‘For_each’)[‘RecordID’]}”,
“Message”: {
“Name”: “Hello there”
}
}
}

thats it.

You can add more steps such as if you need to update Dynamics or any other systems and so on….

Save Logic App

Go to Postman or Fiddler

Call your Logic App url and pass JSON data you created from above website

Job done!