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 stop "OnSuccess...
Power Apps
Answered

How to stop "OnSuccess" method to run conditionally?

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have two forms on the screen:

 

Form 1 - displays and Updates data in Entity1 and in Entity 2 from OnSuccess

Form 2 - displays form of Entity 2

 

I need to implement as follow:

 

If Form1.Mode == Edit, then do not run code written on "OnSuccess" attribute. -> How can I achieve it?

 

Thanks,

 

 

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @dave8 ,

    Set a Variable on the Save process

    If(
     FormName.Mode=FormMode.Edit,
     UpdateContext({vEdit:true})
    )

    then on the OnSuccess

    If(
     vEdit,
     UpdateContext{(vEdit:false}),
     WhateverYourSuccessCode
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @dave8 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard