Confirmation modal option for buttons

Hiya,

It’d be useful to have an option for buttons that enables a confirmation step before proceeding with the action. Useful when you have buttons running a number of actions, especially ones involving deleting rows or sending emails etc and you want to avoid accidental clicks.

You can set this up with OpenRow() action. Make the button open the same row, just in a different layout with confirmation modal. In it you need to press another button to confirm. This button then does the actual action you wanted to do. If you follow Paul’s best practices examples with VIEW pages, you can learn how to do it.

3 Likes

You can also make it inline with the button formula. The button formula is experimental though, and could break anytime.

Here is an example of deleting rows with a confirmation button. The toggle Button toggles the state, if the confirmation buttons should be shown. The confirmation buttons then show the real delete button and again the toggl button with different styling.

3 Likes

If you want a safer option than the experimental button option, you could always do this:

It just utilizes an if statement to change the logic of what the button will do. Try it out

6 Likes

Also, the solution from @Scott_Collier-Weir should work better on mobile :ok_hand:

Nice workarounds, definitely usable solutions in the meantime but I still think it would be an important official addition.

@Scott_Collier-Weir This is a great solution – thanks for sharing. I was wondering, however, would it be possible to integrate a _Delay() to automatically revert the button back to “Delete Row” after a set time (in lie of another button to “cancel”)? RunActions() effectively bundles the entire if-statement and locks the button until it’s complete. I understand an automation could be utilized here, but was curious if there’s another way.

Yeah for sure!

You could use a _delay() and then have it run another action to modify the row to reset the button!

I havent tried it myself to verify, but in my mind it should work just fine

That’s what I was thinking as well, however, unless I’m missing something it would need to be wrapped by a RunActions() would it not? And doing so effectively makes the button inactive until the entire RunActions() function completes (thereby preventing a second click during the delay). At least that’s what I found in my testing.

Effectively it would be:

IF(thisRow.[delete confirmation] = false,
   RunActions(
      ModifyRows(thisRow,thisRow.[delete confirmation],true),
      _delay(
         ModifyRows(thisRow,thisRow.[delete confirmation],false),
      1500)),
_Noop())

Interestingly, even separating the actions out into two buttons has the same effect.

In this case button one toggles the checkbox and then pushes Button 2 which has a delay set up. This method also causes the button to hang in a limbo state until the 3.5 seconds is up, then it runs the modifyRows() function. I would have thought separating them out would have allowed the button to remain active and then modify the row.

Note for anyone following this thread, I changed from an If() to switch() function for no particular reason.

Button

Switch(thisRow.[delete confirmation],
  false, RunActions(ModifyRows(thisRow,thisRow.[delete confirmation],true),thisRow.[Button 2]),
  true, _noop())

Button 2

_Delay(ModifyRows(thisRow,thisRow.[delete confirmation],false),3500)

Sorry, I modified the permissions of your example and now it is not accessible.