Ethan Millar

2 years ago · 1 min. reading time · ~100 ·

Blogging
>
Ethan blog
>
Make HTTP Requests from CRM using Power-Automate

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

  1. 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.
[Bl oe ret is cates

| [onme— ®

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/

Test Accom | rn. san

my Ou Amr sod may ing onde fy Ad od

FEORTE

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.

© Acne Ue pa Tine on one 3 on « fae 1 97501 19808 © teen

© rte rt,

Er Bf

UNIT-TESTING

  • We create a new Account with feeding values to the Coordinates (Latitude and Longitude).
Uju13.jpeg
  • We verify that our Power-Automate triggers and finds out the time-zone based on these coordinates as expected.
AQFsF.jpeg

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!

Comments

Articles from Ethan Millar

View blog
7 years ago · 2 min. reading time

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

2 years ago · 4 min. reading time

Java is considered to be a user-friendly language. When it comes to dealing with the data of the cus ...

7 years ago · 0 min. reading time

This post will explain you the way to clean data and store JSON format to HBase. Hadoop architect ex ...

You may be interested in these jobs

  • Saia Inc.

    Lead Diesel Mechanic

    Found in: One Red Cent US C2 - 5 days ago


    Saia Inc. West Coon Rapids, United States

    Is your career taking you where you want to go? · When it began in 1924, Saia LTL Freight covered a two-state area: Louisiana and Texas. Today, Saia is one of the most successful carriers in the U.S., ...

  • Stability Healthcare

    Stability Healthcare

    Found in: Careerbuilder One Red US C2 - 4 days ago


    Stability Healthcare Worcester, MA, United States

    About Stability Healthcare At Stability, we have built a nurse friendly platform that simplifies finding travel nursing jobs without the need for a recruiter. · We believe in pay transparency and that ...

  • Home Instead

    Caregiver

    Found in: Jobcase US 3 C2 - 1 day ago


    Home Instead Weeping Water, United States

    Home Instead is looking for caring and compassionate Caregivers we call our 'Care Professionals' to · become a part of our team and join our mission of expanding the world's capacity to care. Home In ...