Skip to main content
Dynamics 365 general forum

Refresh section on field change

editSubscribe (0) ShareShare
Posted on by 98

Hi everyone,


I have a Power Automate Flow which updates a field on a custom dataverse table.


Could anyone share the JS syntax for automatically refreshing the section or page when that field changes? The reason I think I would need to refresh the section/page (the equivalent of clicking the Refresh button) is that I have an embedded canvas app in a section which needs to be updated when the field value changes.


My thinking is that I could place the field in a different section and run the JS function on the OnChange property against it.

best regards,


  • Suggested answer
    maeneak Profile Picture
    maeneak 7 on at
    Refresh section on field change
    I came up with a messy workaround using the OnChange event of the control. It triggers a save when the field is 'Dirty' which in turn triggers the flow, then run through a few nested setTimeout's and use showProgressIndicator to restrict/notify the user. I just picked a timeout value I was sure would cover the flow run time, but this is obviously not guaranteed for long flows.
    function SaveFormOnChangeIfDirty(primaryControl, fieldName, interval) {
        var formContext = primaryControl.getFormContext();
        var field = formContext.getAttribute(fieldName);
        if (field.getIsDirty() && field.getValue() != null) {
            Xrm.Utility.showProgressIndicator("Running flows and updating data...");
            setTimeout(function() {
            }, interval);
  • ImranAmi Profile Picture
    ImranAmi 98 on at
    RE: Refresh section on field change

     Eiken  Thank you for the solution. Unfortunately, although the function triggers perfectly when changing a field inside the form, it seems a javascript function cannot trigger when a field has been changed by an external connector (in this case, Power Automate).

    There is a Power Automate flow which updates that field. In the video below, you can see the event triggers when I change the field directly inside the form, but the event does not trigger when a Power Automate Flow changes that field.

    I still find your solution very helpful though so I marked as Solved.

    If you happen to know if it is indeed possible to trigger the refresh, please let me know.


  • Verified answer
    Eiken Profile Picture
    Eiken on at
    RE: Refresh section on field change


    Please use the following API:, errorCallback); 

    Please check the detail of this API.

    data.refresh (Client API reference) in model-driven apps - Power Apps | Microsoft Learn

    Now please refer to my steps.

    Edit the refreshpage function.

    function refreshpage(e){
        var formContext = e.getFormContext();{

    Add On change event to the selected field.(Now I choose ""Name")


    It works well.


Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…


Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,066 Super User

Martin Dráb Profile Picture

Martin Dráb 222,585 Super User

nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans