Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

using flow to update currency exchange rates -

  • 1.  using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 25 days ago
    Has anyone previously tried to use the D365 currency exchange rate with power automate? See link below.

    https://alphabold.com/dynamics-365-update-currency-exchange-rates-using-power-automate/

    I've never tried flow before and having a hard time following the tutorial in some spots. For ex: step 14- where is this Recurrence Action? It's confusing to me.

    any help would be appreciated!!

    thanks,
    Heather

    ------------------------------
    Heather L
    ------------------------------
    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 2.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 25 days ago
    Hi Heather,

    The 'Recurrence' object is actually a special type of action called a 'trigger'.  Each flow starts with one of those to tell it when to fire. Examples include such things as: scheduled (as in your tutorial), when a SharePoint file is created, when an e-mail is received, when a CRM record is created, etc.

    A new flow will typically prompt you for this as the first step when it's created.

    If you want to add it after your flow has been created, you can either
    1) click on the 'new action' button, or
    2) hover your mouse over the line between 2 existing actions, and click on the '+'

    In the 'choose an action' window, you can type in some text to narrow your search, but make sure to change the view from 'Actions' to 'Triggers'.
    screenshot of power automate trigger search


    ------------------------------
    Jeff Woodard
    Chief Technical Officer
    Transportation Financial Services, Inc.
    West Palm Beach FL
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 3.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 25 days ago
    thank you! Its confusing never having done it before! I am following the guide online and I created the exchange rate connector but now I am confused again! haha
    Where do I execute this???
    Step 17 said to execute to get a JSON response?  My screen looks like this below... I dont see an execute option?

    I'm getting anxiety looking ahead at these steps! hah








    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 4.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 24 days ago
    Piece of cake, LOL.  On your second screenshot in the upper right, just out of view is a link called 'Test'.  Since this is a scheduled flow trigger, you'll get an option to test it now.  As it executes, you'll see it go through the steps in your flow. When it's complete, you can click to expand each step and it will show you the inputs and outputs of the data that it processed for that step.

    Separately, if you go back to the main summary page for your flow, you'll see a section for '28 day run history'.  If you click on the date for each one, then you can see the detail of each run and it's associated data.


    ------------------------------
    Jeff Woodard
    Chief Technical Officer
    Transportation Financial Services, Inc.
    West Palm Beach FL
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 5.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 24 days ago
    thanks! After I sent this I was able to execute. I got a step further! haha. but now I am stuck again. I think I did the Parse JSON correctly but then I dont understand where to go for the schema? The steps for 19-21 I dont understand! 
    1. Select Body that was supplied by the Exchange Rate Connector- how do I get that when I click on it I dont get anything? when I click generate it makes me enter something for schema name and I keep getting an error. I tried to copy what appeared on the body- but that is wrong. arghhhh. 

    I am feeling really stupid!

    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)


    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 6.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 21 days ago
    This is turning the JSON given you from the web result into something you can use later on.

    Content is the thing you want to get the data from and use moving forward - in this case, the "Body" from the "Get Latest Currency Exchange" step.

    Schema is a way of telling Power Automate what the it looks like - so it can use it later on in the Flow.

    The site shows you the example response (although you may have more than "SEK"):
    {
      "rates": {
        "SEK": 9.3573926298
      },
    "base": "USD",
              "date": "2019-12-27"
    }

    When you press "Generate from sample", paste that in.

    This means in your next steps, you can use "SEK" etc. If you read step 22, it does say that your bit in yellow will be auto generated.



    ------------------------------
    Matt Beard
    Senior Software Engineer
    Data8
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 7.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 21 days ago
    Thank you @Matt Beard so I was able to get everything accomplished but when I run the test it keeps failing . So instead of SEK as currency, I am using CAD  I am doing something wrong but I dont understand what. It keeps failing at the Update a Record part. Could it be the fields on my account form?







    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 8.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 21 days ago
    Looks like your Flow can't find your CAD currency.

    What does your "Update a Record" step look like in your Flow?

    ------------------------------
    Matt Beard
    Senior Software Engineer
    Data8
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 9.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 21 days ago


    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 10.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 21 days ago
    Am I looking at the right place?


    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 11.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 21 days ago
    What about in your raw flow? So not in a test run (the screenshot underneath step 25 on your blog link you shared).

    It looks on that screenshot like item id (so record identifier) field might have some spaces in but I'd be interested to check that.

    ------------------------------
    Matt Beard
    Senior Software Engineer
    Data8
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 12.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 21 days ago
    this is all I see for record ID- calling it item id?



    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 13.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 21 days ago
    Can you try it again but take the } and { out?




    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 14.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 21 days ago
    eeek!! we are getting closer! I hope!! thank you. that didnt fail right away. However, I received this error message instead:


    I just copied the text inside the body to show it all:

     "error": {
        "code""0x80040216",
        "message""An unexpected error occurred.",
        "innererror": {
          "message""An unexpected error occurred.",
          "type""System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]",
          "stacktrace""   at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, ExecutionContext executionContext, Dictionary`2 optionalParameters)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Upsert(Entity entity)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Update(Entity entity, UpdateOption updateOption)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.UpdateEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, EdmEntityObject entityObject)\r\n   at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntityImplementation(String& entityName, String key, EdmEntityObject entityDelta)\r\n   at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.<>c__DisplayClass10_0`2.<InvokeActionAndLogMetric>b__0()\r\n   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n   at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
        },
        "@Microsoft.PowerApps.CDS.HelpLink""http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040216&client=platform",
        "@Microsoft.PowerApps.CDS.InnerError.Message""An unexpected error occurred."
      }
    }


    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 15.  RE: using flow to update currency exchange rates -

    SILVER CONTRIBUTOR
    Posted 21 days ago
    @Heather Laughlin,

    Have you gotten past this most recent error?? Power Automate can be quite frustrating at times, but it's worth pushing through, I promise!

    Sometimes errors like the one shown have gone away on their own once coming back to the flow. ​

    ------------------------------
    Chad Althaus
    Bray International, Inc.
    Houston TX
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 16.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 21 days ago
    no!! I'm beyond frustrated! I cant figure out what I did. I am sure its user error on my end! hahah. But I dont understand where I went wrong. then it is showing Server errors now (4) once I removed the { and } from the ID like the last suggestion. So I dont know if that is from that or something else. I want to cry!

    This is pushing my final due date back another day then another. I wish I knew what I was missing!

    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 17.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 21 days ago
    We will get you there!

    Firstly, are you 100% sure that is the correct record id?

    Can you show all your inputs on a failed run? You've shown most of your screenshot above but cut it off just after currency precision.

    ------------------------------
    Matt Beard
    Senior Software Engineer
    Data8
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 18.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 20 days ago
    honestly, I am not sure! I started from the link here where it gave steps but I very easily could have messed that up! Here is my link I am using: https://alphabold.com/dynamics-365-update-currency-exchange-rates-using-power-automate/

    I am revisiting all my steps.
    First few times the last "update record" kept failing. then when I removed the { and } yesterday I kept getting server errors failing still on that  update a record step. I am totally at a loss.

    step 1. So I did add the currency for CAD in my sandbox.
    steps 4-7 I already had the fields populated so I just added to the account form on my test account.
    However, I am unsure about the Parse JSON step because on the link it shows JSON 2 and when I do it only shows JSON ? does that matter?
    I also had issues trying to generate the sample (generate sample step) because it kept showing up as empty inside box when I click it.


    my Parse JSON step here:


    When I click Generate Sample this appears:







    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 19.  RE: using flow to update currency exchange rates -

    GOLD CONTRIBUTOR
    Posted 20 days ago
    Okay, I can see a few things in your later screenshots.

    1)

    This looks like you've just typed "CAD" about manually. Rather than do this, you should use the "Dynamic Content" and then pick the "CAD" value listed in there. This will show the data in a purple box - if you look at the screenshot on the blog, you can see it there.

    2)
    A similar thing the update a record - it looks like you've typed the values manually (CAD, 2 and 0.74) but in the blog post, they have again used the dynamic values from the earlier steps of the Flow. I would double check those and check it's inline.

    You can see here on the blog post how they have used dynamic content so try that approach.

    The error you see is an error deep down in Dynamics so I suspect you are performing the update slightly wrong.

    ------------------------------
    Matt Beard
    Senior Software Engineer
    Data8
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 20.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 20 days ago
    Thank you!!! I didnt realize I needed to select from the dynamics value but now I see it populated!! what a newbie I am!! :)

    Let me test again!!

    ------------------------------
    Heather L
    ------------------------------

    The first step toward cloud success. - Migrate from CRM to D365 with expert guidance from Microsoft. I'm Ready


  • 21.  RE: using flow to update currency exchange rates -

    TOP CONTRIBUTOR
    Posted 20 days ago