cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

OnSuccess Missing From Button/Icon Dropdown

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: OnSuccess Missing From Button/Icon Dropdown

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

 

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: OnSuccess Missing From Button/Icon Dropdown

OnSuccess is a property of a form. If you look at the properties of your Form3 control, you should find the OnSuccess property there.
Highlighted
Super User
Super User

Re: OnSuccess Missing From Button/Icon Dropdown

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!

Highlighted
Community Support
Community Support

Re: OnSuccess Missing From Button/Icon Dropdown

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

 

View solution in original post

Highlighted
Community Champion
Community Champion

Re: OnSuccess Missing From Button/Icon Dropdown

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

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,803)