Dynamics 365 Update Currency Exchange Rates using Power Automate

Introduction:

In this blog, I am going to show you how to use Power Automate to update the currency rate in your Dynamics 365 CE instance. Power Automate allows you to create powerful workflows and connect to external systems. In the past, coding and development tasks were essential to the process of updating the currency rate in Dynamics CE. However, in this blog, we will walk you through the process of easily updating the currency rate without coding.

Steps:

  1. Navigate to your organizations, settings and then hit Business Management
  2. Click New and add a new currency named Swedish Krona

Business Management new currency

  1. The exchange rate for the SEK is 9.39
  2. Go to the Customizations and Navigate to the Account
  3. Add new Fields called Total Revenue, type Currency
  4. Add the new field to the form as well as the total revenue base and exchange rate
  5. Save and Purplish the changes

revenue base and exchange rate

  1. Navigate to https://make.powerapps.com
  2. Choose your environment
  3. Click on Solution
  4. Click on Common Data Service Default Solution
  5. Click New and select Flow
  6. Name the Flow as Update Currency Exchange rate
  7. Add Recurrence Action and set the interval to 1 and Frequency to MinuteRecurrence Action
  8. Add another action, select Custom and then Select the Exchange Rates connector. To create the Exchange Rate connector go to URL for “Creating Custom Connector for Power Apps
  9. Type SEK “Swedish Krona” currency in the symbol field

Exchange Rates connector

  1. Now if we execute the flow, we will get a JSON response. Hence, to update dynamics currency record, we would need to parse the JSON response
  2. Add another action and Select Parse JSON

dynamics currency record

  1. Select Body that was supplied by the Exchange Rate Connector
  2. Click Generate from Sample
  3. Type the Response you got from the API (Exchange Rate Connector)
{
  "rates": {
    "SEK": 9.3573926298
  },
"base": "USD",
          "date": "2019-12-27"
}
  1. The platform will create the Schema as highlighted in yellow above
  2. Add an action to define a variable and assign the value from the Exchange Rate to the variable

Exchange Rate variable

  1. Add another Action and select the Common Data Service, Update a record

Common Data Service

  1. Type the Environment, Entity name and Record Identifier and Exchange Rate as shown in the image below

Record Identifier

  1. Save the flow and click on Flow Checker.
  2. Before running the flow, let’s test the current exchange rate that was initially set to 9.39 as shown in step 2
  3. Navigate to your organization and then Account, select an existing account and type values as highlighted. The exchange rate and total revenue base are read-only

Flow Checker

  1. Now Test the flow

Test the flow

  1. As seen below the flow executed successfully

flow executed successfully

  1. Now create a new account and let’s check the exchange rate, as seen from the image below the exchange rate is 9.35 instead of 9.39.

account exchange rate

  1. The flow will be automatically running every 1 minute to update the exchange rate that will be only an impact on the newly created records and not the existing records.

new created records

Conclusion:

Conclusively, the Power Automate platform takes automation business processes to the next level of efficiency. It has a user-friendly interface with simple steps to automate a task. This platform allows for regular updating of currency rates without the need for IT development.

If you have any questions or insights regarding this blog, feel free to leave a comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *