Hi, I’m an intern at a startup company and have been using bubble for about a month now.
I was assigned the task to build a popup element so the user can confirm or cancel the deletion of a certain thing, usually the thing is in a repeating group. It would be ideal for us to be able to use this popup in different pages where the user can delete things, hence why I need it to be a reusable element.
Right now I’m using the following strategy: I created a type Confirmation in the DB, with the fields: Answer (yes/no) for the confirmation of deletion and Message, where I store the message that shows up in the popup, it may vary from page to page, but it says something like “delete file?”, and the user answers accordingly with the buttons YES or NO on the popup. My problem is with the Answer. The user can click on NO and the popup will simply hide itself, but when the user clicks on YES it should change the value of the field Answer in the DB from no (default) to yes, so I can take that and use it as a reference in the page’s own workflow, where it will only delete the thing when the field Answer (type Confirmation) is yes.
I’m not sure if this strategy is entirely correct, so maybe I’ll have to change it. I’m open to suggestions on how to improve what I’m already doing and also to a whole new approach to this problem.
Just to summarize: I want to build a reusable popup element to confirm the deletion of a thing, how can I make that?
Thanks, Eduardo.
The reusable element thing is easy enough. Set two states on the popup “object” and “id”
On press no, clear the states and hide the element
On press yes there needs to be a workflow in the popup to delete a thing, one workflow step per thing that uses the popup (only when object = whatever), where unique ID is the id state.
You don’t need to go near the database but it’s not mega reusable as every time you want to use it on a new object you need to add a workflow step in your reusable. That said you can reuse it if you’re deleting from multiple locations.
The problem with adding a “delete thing” action on the reusable element for each page is that once you edit it for one page it will do the same for all of the pages that have the reusable popup. So it doesn’t really work if it has any specific workflows in it. What I want with this popup is to confirm the deletion, the deletion itself should happen on the page’s own workflow.
Agreed. That’s why the question set is not a very good one.
This topic was automatically closed after 70 days. New replies are no longer allowed.