cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Is there an equivalent of a Return statement for PowerApps Formulas?

To avoid horrendously huge nested if statements, is there an equivalent of a Return statement to quickly jump out of a formula:

 

i.e.

If(!IsBlank(txtActualQtyDelivered_3.Text),
Set(vActualQty,RGBA(255,0,0,1));
Set(valid,false);)
if(!valid,
Notify("Please fill out all the required fields.");
Return;)
// next statement - input fields all valid
3 REPLIES 3
Super User III
Super User III

@stapes 

There is not, but you might want to consider a slightly different design approach.  Rather than having a user hit a button to then be confronted with an error, instead perhaps disable the button until the form is completed.  Then there is no need for the complex logic (except in your DisplayMode property - which can be offset to another control).

Have your controls be more dynamic on the form to display the fact that they are required rather than have the user have to figure it out from an error message.

Just a thought...I hope it is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Anonymous
Not applicable

Hi @stapes ,

 

I don't believe there is an equivalent of a Return statement. Could you possibly use the Switch statement instead?

I have had to learn how to control the user experience within PowerApps available modifers:

(ie I will have a button that runs a flow, but i want to make sure that the data I am sending in the flow is ready.

  1.  I have an HTMLtext box that uses Concat to build an HTML document.
  2. I don't want the user to run the flow until my data is ready
  3. Within the Visible property I use expression "<!DOC" in MY_HTML_TEXT.HtmlText  when it is true, the button is visible, when it isn't true it is hidden.

 

Good luck crafting solution

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (37,004)