web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / OnSuccess Missing From...
Power Apps
Answered

OnSuccess Missing From Button/Icon Dropdown

(0) ShareShare
ReportReport
Posted on by

I want to have my form submit button also do something 'onsuccess', yet it doesn't exist. I cannot find this option anywhere.

 

What am I doing wrong?

Categories:
I have the same question (0)
  • timl Profile Picture
    36,393 Super User 2025 Season 2 on at
    OnSuccess is a property of a form. If you look at the properties of your Form3 control, you should find the OnSuccess property there.
  • wyotim Profile Picture
    2,545 on at

    Hey @MagnaCogitere, good news: you aren't doing anything wrong! The OnSuccess field is in the form and can't be applied to the button directly. You could set up a variable in the OnSuccess section of the form and use that to effect the button. Something like:

    // Put this in the OnSuccess field of your form to update the variable
    ...other code...
    UpdateContext({varFormSuccess: true})
    
    
    // Put this in the Color field of your button to respond to the variable
    If(
     varFormSuccess = true,
     Green,
     Red
    )

    This example would change the color of the button to green if varFormSuccess is true. You would also want to have a way to reset the variable, like when you load a new form or something like that.

     

    Even better would be to use the OnSuccess, OnReset, and OnFailure fields of the form to have more variety. Something like:

    // Put this in the OnSuccess field of your form to update the variable
    ...other code...
    UpdateContext({varFormSuccess: "Success"})
    
    // Put this in the OnReset field of your form to update the variable
    ...other code...
    UpdateContext({varFormSuccess: "Reset"})
    
    // Put this in the OnFailure field of your form to update the variable
    ...other code...
    UpdateContext({varFormSuccess: "Failure"})
    
    // Put this in the Color field of your button to respond to the variable
    Switch(
     varFormSuccess,
     "Success", Green,
     "Reset", Blue,
     "Failure", Red
    )

    This example would change the button color to green on success, red on failure, and blue when the form is reset.

     

    There are any number of ways you could use this but hopefully this gives a good start. Let me know if this is helpful enough or if I can help further!

  • Verified answer
    v-yuxima-msft Profile Picture
    on at

    Hi @MagnaCogitere ,

     

    @timl 's @wyotim 's replies are right. OnSuccess is one property of Form.

    OnSuccess – How an app responds when a data operation has been successful.

    • This property applies only to the Edit form control.

    20190503OnSuccess.PNG

     

    More infr=ormation:

    control-form-detail

     

    Hope this would be helpful.

     

    Best Regards.

    Yumia

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks for posting in the community @MagnaCogitere - can you review the above replies and update the thread if they were helpful?

     

    Thank you,

     

    @Anonymous 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard