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.
Laern more about our Dynamics 365 Services
Steps:
- Navigate to your organizations, settings and then hit Business Management
- Click New and add a new currency named Swedish Krona
- The exchange rate for the SEK is 9.39
- Go to the Customizations and Navigate to the Account
- Add new Fields called Total Revenue, type Currency
- Add the new field to the form as well as the total revenue base and exchange rate
- Save and Purplish the changes
- Navigate to https://make.powerapps.com
- Choose your environment
- Click on Solution
- Click on Common Data Service Default Solution
- Click New and select Flow
- Name the Flow as Update Currency Exchange rate
- Add Recurrence Action and set the interval to 1 and Frequency to Minute
- 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”
- Type SEK “Swedish Krona” currency in the symbol field
- 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
- Add another action and Select Parse JSON
- Select Body that was supplied by the Exchange Rate Connector
- Click Generate from Sample
- Type the Response you got from the API (Exchange Rate Connector)
{ "rates": { "SEK": 9.3573926298 }, "base": "USD", "date": "2019-12-27" }
- The platform will create the Schema as highlighted in yellow above
- Add an action to define a variable and assign the value from the Exchange Rate to the variable
- Add another Action and select the Common Data Service, Update a record
- Type the Environment, Entity name and Record Identifier and Exchange Rate as shown in the image below
- Save the flow and click on Flow Checker.
- Before running the flow, let’s test the current exchange rate that was initially set to 9.39 as shown in step 2
- 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
- Now Test the flow
- As seen below the flow executed successfully
- 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.
- 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.
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.