Safety "Do you really want to ...?" conditional

I want to ensure that the user really wants to delete an item in a list by asking the question “Do you really want to delete this item?” and then either proceed if the user clicks a positive response or do not delete the item and leave the user where s/he was before clicking on the delete button.

I tried to see if there was anything in the action operations that I could do to create a “careful delete row”, but couldn’t fine anything to build this action.

Any ideas?

1 Like

You could try to set an action to link to screen ‘this Item’ to get a new screen. Then have your, ‘are you sure’ and another delete button that does the actual delete and a go back.

1 Like

I have done this previously using a switch with caption “Delete this item” which then enables a button and even a hint. It works quite well.

3 Likes

+1 for this approach. On the final screen I add a bar button, one to go back, one to actually delete (and go back one more time to the original screen with the list of items, adding to the native go back by the delete action).

1 Like

I often use a “delete” button that hides itself and then shows a button bar with

  1. a “confirm” that actually deletes the item and
  2. a “cancel” button that brings back the “delete” button
3 Likes

I did this

Button - Delete

Then set an action on this delete button which increments a field by 1.

If increment is 1 hide delete button

Then show button bar and warning text if increment is 1

Delete button then has an action to delete
Cancel button resets increment so it’s no longer 1

6 Likes

Very nice, Jason :+1:

3 Likes

And, to be consistent in my desire to see easy solutions to common requirements prevalent in Glide, I think “careful delete” is a very important feature to encourage in all apps. Glide should provide a standard way to do this: not that it is the only way, but for newbies (and lazy people like me :slight_smile: ) is very useful.

1 Like

Doesn’t the native Delete through the edit mode already ask for confirmation? I’m guessing if you are instead doing it through an action, you should know that you want something to be deleted blindly and in a lot of cases, you may not want a confirmation if it’s a backend action. If you want different results, then you should “program” for it accordingly. Are you saying that every single time the Delete Action is fired, that an automatic confirmation should pop up, or would it be optional depending on the circumstances of the delete? Just my thoughts on trying to cover every single possible scenario.

1 Like