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!