web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to execute an comm...
Power Apps
Answered

How to execute an command from value returned from MS Flow "Respond to PowerApps" action.

(0) ShareShare
ReportReport
Posted on by 3,347

I need to execute refresh commands after a flow reports back as "true".  I have the flow setup, and returning the value "true", but I cannot find a way to get that value to trigger a refresh.

 

I tried putting the refress in a button "OnSelect", then in an input text box, having the OnChange=Button1.Pressed.  The Text field of the TextInput=First(MSFlow).finised.  <-- equals true when the flow is finished.  However, the OnChange does not execute.  

 

Any ideas?

Categories:
  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    Hi @martinav,

    How and where are you executing the Flow? Since actions run in a series unless you use Concurrent, you can check the result of the flow and refresh accordingly right after the flow.

  • martinav Profile Picture
    3,347 on at

    @Mr-Dang-MSFT,

     

    Thank you for your reply.

     

    This issue is that the screen needs to be refreshed with the value that is returned from the "Respond to PowerApps" action from flow.  I have been sucessful in using returned values in visible actions, to make things visible turn on/off, but..  there is no way that I can find to execute a refresh command.   Simply putting refresh() after my run command will not work.  The flow can take 10-20 seconds to execute before returning a value.  There is no feedback to tell the command in powerapps to wiat for the flow to complete.  Once it executes, it moves on to the next command.  There is no concurrent() being used.

     

    This is my command for running my flow.

     

    UpdateContext({ShowKDLPostPopup:false}); ClearCollect(FileInObs,KDL_File_Management.Run(ECN_ERelease_BrowseGallary.Selected.Rev-1,ECN_ERelease_BrowseGallary.Selected.Part_x0020_Number,LookUp(Drawing_Vault,DV_PartNumber=ECN_ERelease_BrowseGallary.Selected.Part_x0020_Number And DV_RevisionNumber=Value(ECN_ERelease_BrowseGallary.Selected.Rev),ID)))

    Adding a Refresh() at the end of that line will not wait for the returned value from the Flow.  It will refresh the screen immediately after the flow runs, not after the flow is finished.

     

    It would work to use a timer, but you would have to put a delay in there long enough to cover the longest wait time for the flow to finish.  That has too much variability, so there would be a lot of unnecessary wait time for most cases.  I want the refresh to occurr exactly when the flow is completed, no sooner, no later.

     

    Respond to Powerapps works great for visible controls because I can have it return a true/false value which will fit perfect in the Visible control.  

     

     

  • Verified answer
    Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @martinav wrote:

    Simply putting refresh() after my run command will not work.  The flow can take 10-20 seconds to execute before returning a value.  There is no feedback to tell the command in powerapps to wiat for the flow to complete.  Once it executes, it moves on to the next command.  There is no concurrent() being used.

     


    @martinav, Can you share about what your flow is doing? Are you delaying any actions in flow?

     

    PowerApps will not move onto the next action until the flow is complete. You can test this by using a variable to count up after the flow. The count does not increase until the flow completes.

     

    • Can you check that your flow is successful?
    • Are you only expecting true to return from flow to PowerApps, or are you returning a table? 
    • What is in the collection FileInObs?

    Below is a screenshot where I'm inserting a row using flow. I increase runcount by 1 each time the flow successfully runs. Then I refresh the table so that the flow's changes to the table appear.

     

    Annotation 2018-12-15 221042.jpg

     

     


    @martinav wrote:

     

    This issue is that the screen needs to be refreshed with the value that is returned from the "Respond to PowerApps" action from flow. 

     


    • What do you mean by "the screen needs to be refreshed?" What is being refreshed?
    • Tables can be refreshed by Refresh(). Is there something else you are trying to refresh?
  • martinav Profile Picture
    3,347 on at

    Oh!  I had no idea the clearcollect() would wait on the flow to complete.  That is super good news!  Wow, thanks so much!  I do feel a little stupid for not trying it, but I just assumed...

     

    Thank you!

  • poozr Profile Picture
    2 on at

    I have tried this, but my flow takes more than 90 seconds and the PowerApp times out waiting on the flow.  So then the flow fails when it cannot return the value to the PowerApp because the connection is closed.  I can't seem to get past the 90 second timeout.  Any help would be appreciated.

  • Magra Profile Picture
    on at

    @Mr-Dang-MSFT , @martinav 

    I'd like to add that this only seems to work if PowerApps gets some kind of feedback from the flow.

     

    In my case the flow creates a PDF file which PowerApps is supposed to open afterwards with the launch command. A workaround for the still missing print function in PowerApps. However even with ClearCollect PowerApps kept opening a new window with a "File not found" error. Means it clearly didn't wait for the flow to finish.

     

    The solution was to insert a "Respond to PowerApps" component into my flow and have it return some dummy value to PowerApps. Now it works like a charm.

     

    So, nevertheless, ClearCollect really saved my day.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard