Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

Auto Refresh After Flow Run & Field Value Change

Posted on by 70

Hi,

I have created a flow in Power Automate which will set the value of a field based on changed value of a Lookup field. Now the problem is since flows are asynchronous, I can see the change in my field value only after I save and refresh the page. So if I change my Lookup value, I dont see a corresponding change in my other field unless I refresh the page. But I want the change in the other field to show as soon as my Lookup value changes. So I tried using the data.refresh JS code that is supposed to refresh without loading the page, on OnLoad & OnChange event of my Lookup field, but somehow my function is not working. Here is my code...

function onLookUpChange(executionContext) {

var formContext = executionContext.getFormContext();

formContext.data.refresh(save).then(successCallback, errorCallback);

}

Can someone please tell me what is wrong with my code? Or if you know any other way of loading the field value as soon as the Look Up value changes, please let me know.

Thanks!

  • D365 User 06 Profile Picture
    D365 User 06 70 on at
    RE: Auto Refresh After Flow Run & Field Value Change

    Thank you Abdul Wahab for your suggestions. This seems like a good workaround to refresh the page, but I thought instead of using Flow and JS together, if I'm using JS, might as well write a JS code to fill my field instead of using Flow. My field needs to be filled with a value from a related entity, so I used the function retriveRecord to get the field value from the related entity.

    However, since this is a good workaround to my initial question (i.e., how to auto-refresh page after flow), I will mark your suggestion as the suggested answer. Thank you!

  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Moderator on at
    RE: Auto Refresh After Flow Run & Field Value Change

    Hi D365 User 06,

    Yes as your power automate is running on the change of the lookup column. It might be the workaround to refresh the column.

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

  • D365 User 06 Profile Picture
    D365 User 06 70 on at
    RE: Auto Refresh After Flow Run & Field Value Change

     Hi Abdul Wahab,

    Thank you for your response. I went through the link you had provided on Opening the form again, so should I add this JS code on onChange event of the Lookup field to refresh the form?

    Thanks! 

  • Verified answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,070 Moderator on at
    RE: Auto Refresh After Flow Run & Field Value Change

    Hi D365 User 06,

    As per my understanding, your flow runs after the refresh action. In such a case, it will not be going to refresh. You need to write some plugin or JS to populate another column to see the instant change. You can do one thing more. Open the form again through openForm (Client API reference) in model-driven apps - Power Apps | Microsoft Learn .

    It might be sorted out your refresh after flow runs.

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,554 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans