web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details
Power Apps - Building Power Apps
Answered

Equivalent of return with negative if

Like (0) ShareShare
ReportReport
Posted on 23 Apr 2024 08:16:15 by 42

I need to check a condition and stop execution if that condition is met. 
I found this as example :
Solved: How to control formula execution in powerapps? - Power Platform Community (microsoft.com)

 

 

If(
 YourNegativeCondition,
 Notify("YourNotification",NotificationType.Error),
 CarryOnWithWhatever . . .
)

 

Not sure to have understand it, because i can use only a statement in the If condition per branch. 
So the CarryonWithWhatever must be a single instruction. How can i achieve that if i neet to insert multple function in the CarryOnWithWhatever?

 

Eg of my CarryOnWithWhatever :

 

SubmitForm(Form1);;
If(IsBlank(Form1.Error);Reset(myControl1));;
If(IsBlank(Form1.Error);Reset(myControl2))

 


I would avoid to set a localContext boolean and then proceed with many if line one for each instruciton

  • Verified answer
    BCBuizer Profile Picture
    22,262 Super User 2025 Season 2 on 23 Apr 2024 at 09:13:36
    Re: Equivalent of return with negative if

    Hi @Simone_01 ,

     

    If I understand correctly you want to execute multiple formulas in the context of an If function.

     

    For that you can use chaining, in your case that's the ';;" operator:

    SubmitForm(Form1);;
    
    If(
     IsBlank(Form1.Error);
     Reset(myControl1);;
     Reset(myControl2)
    );;
    

    With the above, after Form1 has been submitted without errors, both myControl1 and myControl2 will be reset.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete