cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: How to execute an command from value returned from MS Flow "Respond to PowerApps" acti


@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?

View solution in original post

5 REPLIES 5
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: How to execute an command from value returned from MS Flow "Respond to PowerApps" acti

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.

Super User
Super User

Re: How to execute an command from value returned from MS Flow "Respond to PowerApps" acti

@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.  

 

 

Highlighted
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: How to execute an command from value returned from MS Flow "Respond to PowerApps" acti


@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?

View solution in original post

Super User
Super User

Re: How to execute an command from value returned from MS Flow "Respond to PowerApps" acti

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
Level: Powered On

Re: How to execute an command from value returned from MS Flow "Respond to PowerApps" acti

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.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 176 members 5,820 guests
Please welcome our newest community members: