Make HTTP Requests from CRM using Power-Automate
A few years ago, making an HTTP call from Dynamics CRM Services used to be very complex. The developers had to resort to C# Plugins or Workflows. In this blog, we will learn how we can consume an HTTP API by triggering an event from D365 CE (CRM) with the help of a Power-Automate (Flow).
The requirement would be – Once a user creates a D365 Account providing values to Latitude and Longitude, a Power-Automate must make a GET request to the Bing Maps API and find the time zone based on the given account Coordinates.
STEPS
- We create a new Power-Automate (Flow) that triggers on creation & update of account rows, provided the columns address1_latitude & address1_longitude are not empty. We also add a string variable called timezone_name.

2. Next, we add an HTTP action to make a GET request to the Bing Maps API. Here, the URI must be of the format:
https://dev.virtualearth.net/REST/v1/timezone/@{triggerOutputs()?['body/address1_latitude']},@{triggerOutputs()?['body/address1_longitude']}?key=<BingAccountKey> |
You can create your own Bing Maps Dev Center key by signing into the Bings portal - https://www.bingmapsportal.com/.

3. We parse the output of the above action into a JSON schema. The content would be (with the help of an expression) - @{body('HTTP_-_Get_Timezone')['resourceSets'][0]['resources'][0]}. The JSON schema is as follows:
{"type":"object","properties":{"__type":{"type":"string"},"timeZone":{"type":"object","properties":{"genericName":{"type":"string"},"abbreviation":{"type":"string"},"ianaTimeZoneId":{"type":"string"},"windowsTimeZoneId":{"type":"string"},"utcOffset":{"type":"string"},"convertedTime":{"type":"object","properties":{"localTime":{"type":"string"},"utcOffsetWithDst":{"type":"string"},"timeZoneDisplayName":{"type":"string"},"timeZoneDisplayAbbr":{"type":"string"}}}}}}} |
4. Finally, we set the value of the timezone_name variable to genericName from the output of the Parse JSON output action. Save these changes in the Power-Automate.

UNIT-TESTING
- We create a new Account with feeding values to the Coordinates (Latitude and Longitude).

- We verify that our Power-Automate triggers and finds out the time-zone based on these coordinates as expected.

CONCLUSION
Hence, we were successful in getting an API response after making an HTTP GET request in our Power-Automate (Flow), which triggers an event in D365 CE (CRM). Likewise, we can make HTTP PUT, POST, PATCH and DELETE requests as well.
Stay tuned for upcoming blogs!
Articles from Ethan Millar
View blog
While many Microsoft Dynamics AX technical users and developers are trying their hands on the latest ...

Hadoop integration professionals will make you learn how to explore metadata in kind of tables in Ap ...

An economic cycle contains many ups and downs, which are constantly in effect. Though navigating dur ...
You may be interested in these jobs
-
Card Production Associate I
Found in: beBee S2 US - 1 day ago
FIS Global San Antonio OTHERPosition Type : · Full time Type Of Hire : · Experienced (relevant combo of work and education) Education Desired : · General Equivalency Diploma Travel Percentage : · 0%Job Description · Salary for this position is $18.00 hr. · **New location coming soon** · 6550 N. Loop 16 ...
-
Assembly Associate
Found in: Jooble US - 12 hours ago
Kelly Services Sidney, OHClick to Quick Apply Today1 st Shift Pay Rates Starting at $19.00 per hour · $3000.00 SIGN ON BONUS THAT GETS PAID LUMP SUM AFTER 90 & ANOTHER $3000.00 THAT GETS PAID OUT AT 180 DAYS = $6000.00 IN BONUSES · What's next for you? This great job. Finding a job that fits your life ...
-
iXBRL Engineering Lead
Found in: beBee S2 US - 5 days ago
Toppan Merrill LLC Minneapolis Regular, Full timeJob Description: · We are seeking a Lead Engineer to design and lead a team to build a new iXBRL Product. Our Engineering Leads are recognized experts in multiple technology domains and own the vision for their Team and Product. They are responsible for driving their team , assis ...
Comments