Programming an Undo Button

Arguably the most important function ever created from user stand point…

Has anyone had any success programming this in to their app? For instance if you have a button that deletes something in the database, it is hit accidentally…thank god for UNDO!

I imagine this feature would is not currently available, and may take major work on Bubbles backend - but wanted to make sure I wasn’t missing something.

I’ve tinkered with it for certain things, like making changes to my user profile or something. The way I’ve done it is by visually making the change using conditions, then upon some other event (like the undo button disappearing), I’ll actually make the change in the DB. It’s kinda like how Google Inbox lets you “undo” deleting a message, but it’s not a blanket undo for everything.

1 Like

This is something that you can implement. Just maintain a history of changes and when the undo button is pressed, retrieve the latest event and revert it.


Can you bring back something that was deleted from the database?

You can mark something as deleted but not actually delete it from the database.

1 Like

@Scott - A history of changes…would it be a history for each thing in your DB that might change…once the change happens on the original thing, record the change in the “history thing” of that thing?

It really comes down to the design of your data. You are free to maintain it on the object or not, depending on how you want to interact with it when saving the “delete” and performing the undo action.

1 Like

Ok I think I’m starting to catch on…what @potentialthings is saying is, at first, the disappearance of the data is visual (with a conditional) - then upon some other confirmation of the user not wanting to change it (navigating to another page perhaps), then the real delete happens.

In my specific situation, the delete happens in a repeating list which displays all the data in my database to the user…not sure off the top of my head if that condition trick would work with a “Current Cell”

A couple of approaches come to mind (overlap with some of the prior ideas mentioned).

  • Time-delayed delete: User clicks a button on the repeating group to delete an item. This schedules an API workflow to delete said item X second in the future. (Apply some sort of fade conditional state to give the user content).

  • Marked for Deletion Field: apply a yes / no criteria when the user clicks Delete option. Have the repeating group only display active data (ie. not marked for deletion). Apply an additional API workflow to remove marked for deletion data if you see fit.

  • Utilize a changes log: when a workflow is run that deletes/updates the data, have a corresponding log item created that references the state of data prior to the update. Then have an “Undo” workflow that references the corresponding record to undo the mistake.


@potentialthings, @Scott, @dan1 - Thank you all for your input on this - it helped me and I think provides a good reference for this topic in the forum. That being said, I’m going to mark @dan1 comment as the solution because it provides a good summary of the possibilities discussed in this thread.

Thanks again.

1 Like

@chrisschrade thank you, I appreciate it :slight_smile:

1 Like

@dan1 I tried your middle solution (“Marked for Deletion Field”), and although I have no errors in the console, I unfortunately can’t get it to work.

I have two buttons: “Delete All” and “Undo”

  1. The “Delete All” button works perfectly
  2. The “Undo” button, which sets the (y/n) data field in the opposite direction, does not work

This works:

This does not:

And these are the Repeating Group’s Settings:

I can’t for the life of me figure out why it isn’t working. Your help is very much appreciated!