Halting Trigger Execution

I have a button with several triggers associated with it. Under certain conditions (incomplete input from other step widgets) I want to avoid firing some or all of the triggers. Besides adding all the conditions to “not fire” to each trigger, is there a way for a single trigger to behave in a manner that would preclude the subsequent triggers from firing? This would allow me to make the check on whether to proceed in a single trigger that either allows or aborts the rest of the button logic.

hey Lance, this is an interesting question!! I’m curious to hear what others suggest.

one way I would think about solving this is by creating a new Step, and having all your Triggers on Step Enter for that Step and then end with a Transition to return to the previous Step. on the Button click, you can define whether or not to Transition to the Step with the Triggers.

do you think this solution could work for you?? let us know!!

@gio Your approach certainly sounds feasible. I’ll have to play with it to see what the user experience is like for transitioning quickly to the step that performs all the logic and then back to the data entry step.
I was wondering if I could do something similar like make the first trigger check for valid setup and if something looks wrong navigate to a temporary step that then navigates back to previous. I just wasn’t sure if that navigation would thwart the subsequent triggers from firing. I’ll play around a bit. Thanks!

OK, thanks for the update @Lance.

it shouldn’t thwart subsequent Triggers. this example that @freedman shared makes use of this technique actually: Quick tips - Looping!

let us know how testing goes!!

Just came across the very same problem… except that in my case I am not able to just add yet another step… there are already too many…

I am also looking for a way to just stop any further execution and basically halt at the step that is causing the exception… :neutral_face: …ideally coupled with a stationary error that does not just disappear by itself like the error messages that are currently available.

Hi @sebme,

you could create a boolean variable called “valid” or something.
At each step you enter, you do a cleanup trigger that clears some values and sets some defaults and so on. One of the defaults is that you set the variable “valid” = true.

Whenever an if statement decides that an input is invalid or missing, the variable “valid” must be set to false.

All dependent triggers check for “If valid = true” as a condition.
The last trigger contains a message if valid = false.

I hope this helps.
It may seem complicated, but it is actually simple and easy to implement.

Sure… but all this overhead just to halt execution? You have to introduce a trash variable. You need to add additional condition blocks…

As complexity of you app grows you have a lot of fun keeping things lining up…

The alternative is checking all conditions in every single trigger.
What is your vision of an easyer solution?

If you need a better solution, you could make a product suggestion to make an error message with an interrupt resulting in stopping all triggers from there on. Or an overriding condition that triggers are executed at all.
This would be possible but would not allow anything else to happen.
So the only solution to completely reach this is to allow trigger nesting (a trigger activating a group of triggers) thats exactly what happens with new steps. There is also an easy workaround with one additional step and one variable.

If we are talking about a product suggestion like this, you could choose one way you like and suggest it.