cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DineshPathak
Level: Powered On

How to disable PowerApp controls while the flow is run?

Hi Everyone,

 

Is there any way by which the controls on PowerApp screen are disabled while the flow is run?

Or if there is any way to find whether flow fail or succeed in PowerApp?

1 ACCEPTED SOLUTION

Accepted Solutions
rikdekoning
Level: Powered On

Re: How to disable PowerApp controls while the flow is run?

Is there any way by which the controls on PowerApp screen are disabled while the flow is run?

  • Initialize a variable 'flowRunning' on the start of your PowerApp and set its value to false
  • On your control which runs the flow, first set the 'flowRunning' variable to true, then run the Flow and after that, set the variable to false again

flow.png

  • Now set each control that you want to disable to disabled,  based on this variable: 
    If(
        flowRunning,
        Disabled,
        Edit
    )

flow.gif

Or if there is any way to find whether flow fail or succeed in PowerApp?

  • Initialize a variable 'result' in your Flow
  • Place the Flow actions of your process into a Scope
  • Add 2 parallel 'Set variable' actions below your scope
    1. One to set the value of 'result' to 'Success'
    2. One to set the value of 'result' to 'Failed'

flow2.png

  • Set the Run after condition of the 'Success' action to 'is succesful'
  • Set the Run after condition of the 'Failed' action to 'has failed and has timed out'

flow3.png

  • Add a Respond to PowerApps action to the end of your Flow > Add an output > Text > 'result' with the result variable

flow4.png

  • Set the Run after condition for the Respond to PowerApps action to 'is successful' and 'is skipped' for both Set variable actions.

flow5.png

  • Change the Run() function of the control of your Flow that runs your Flow to the following: 
    Set(
        powerappsResult,
        PowerAppsbutton.Run()
    );
    This will set the powerappsResult variable to a record that contains all outputs you've configured in your Respond to PowerApps action. You can get the result by using powerappsResult.result in a label for example:

flow2.gif

2 REPLIES 2
Super User
Super User

Re: How to disable PowerApp controls while the flow is run?

@DineshPathak 

 

For restricting the user from making any changes when the flow is running, you can add a loading screen and set its visibilty to true only when the flow is running, this could be done by following below steps:
 
1) Create a rectangle and stretch this on your whole screen, please make sure this is at the highest layer. Set its color to light gray (So that it covers the color screen and restrict all the controls usability).
 
2) Now download a gif of loading spinner from internet and upload this a media on your app. Insert an image control and put this gif as the image.
 
3) Set the visible property of both the controls to SpinnerTest
 
4) Now set the value of SpinnerTest variable on the button which triggers flow as:
 
Set(SpinnerTest,true);'PowerApps - Flow'.Run();Set(SpinnerTest,false)
 
This will show a spinner when the screen is getting loaded.
 
For getting the Flow Execution status, currently there is no such feature in the app. You can return a success message as a response to powerapps using "Respond to PowerApps" action in flow, but this will only be received if the execution completed successfully.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
rikdekoning
Level: Powered On

Re: How to disable PowerApp controls while the flow is run?

Is there any way by which the controls on PowerApp screen are disabled while the flow is run?

  • Initialize a variable 'flowRunning' on the start of your PowerApp and set its value to false
  • On your control which runs the flow, first set the 'flowRunning' variable to true, then run the Flow and after that, set the variable to false again

flow.png

  • Now set each control that you want to disable to disabled,  based on this variable: 
    If(
        flowRunning,
        Disabled,
        Edit
    )

flow.gif

Or if there is any way to find whether flow fail or succeed in PowerApp?

  • Initialize a variable 'result' in your Flow
  • Place the Flow actions of your process into a Scope
  • Add 2 parallel 'Set variable' actions below your scope
    1. One to set the value of 'result' to 'Success'
    2. One to set the value of 'result' to 'Failed'

flow2.png

  • Set the Run after condition of the 'Success' action to 'is succesful'
  • Set the Run after condition of the 'Failed' action to 'has failed and has timed out'

flow3.png

  • Add a Respond to PowerApps action to the end of your Flow > Add an output > Text > 'result' with the result variable

flow4.png

  • Set the Run after condition for the Respond to PowerApps action to 'is successful' and 'is skipped' for both Set variable actions.

flow5.png

  • Change the Run() function of the control of your Flow that runs your Flow to the following: 
    Set(
        powerappsResult,
        PowerAppsbutton.Run()
    );
    This will set the powerappsResult variable to a record that contains all outputs you've configured in your Respond to PowerApps action. You can get the result by using powerappsResult.result in a label for example:

flow2.gif

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 148 members 4,617 guests
Please welcome our newest community members: