Conditional confirmation dialogs?

We quite frequently have scenarios where our users can perform actions and we want to have confirmation dialogs. This works well whenever we ALWAYS want the confirmation for that query, but in most UIs we only want i enabled during certain conditions, for example if a number is large enough etc. Currently this means we would have to duplicate the queries and have the button trigger a script which checks which actual query to trigger, but this just leads to a ton of other problems.
It would be great if confirmation dialogs could be enabled on the button instead and have some kind of "enabled" setting that accepts a function. This way we could use the same query everywhere, and control the confirmation from the context where it is used.

There are multiple ways to do this!

  1. You can turn on query confirmation conditionally using JavaScript directly in the query.

  2. To have more flexibility in altering the look of the confirmation modal, you can also have the button directly open a modal frame from which you trigger the query. A button can have multiple event handlers (one to trigger the query, one to open the modal) that can be conditionally disabled & enabled using the "Only run when" condition in the event handler's settings.

Hope this helps!

1 Like

Oh! Is that new? I thought I checked for exactly that about two weeks ago. But that is awesome, thanks :slight_smile:

IIRC this has existed for some time already – albeit neatly hidden away :slight_smile:
Glad I could help you, feel free to mark my answer as the solution :mirror_ball: