Well, it’s difficult to give any specific answers without knowing exactly what you’re trying to do in your app…
But, put simply, all you need to do is somehow define (presumably in a custom state) the action that you want to take upon confirmation (along with any database objects that you want those actions to run on, if there are any), and then use conditional actions to run that defined action when the confirmation button is clicked.
For example, lets say you have 3 possible actions:
- Delete a file
- Delete a user
- Remove an Image from a User’s list of images.
When whatever initial actions are taken to open the confirmation popup occur, you’ll need to set a custom state value somewhere which you’ll use (via conditional workflow actions) to define which follow up action should take place when the Confirm button is clicked.
For example, if the ‘Delete a User’ button is clicked, then set a text custom state value somewhere to ‘Delete User’, and another custom state value to the ‘User’ to be deleted (to be honest you might not even need the first custom state - it really depends on your use case).
In your ‘When Confirmation Button is Clicked’ workflow you’ll have 3 actions, with conditionals to control which one happens.
One of those will be ‘Delete User’ with the condition to run only when the ‘Action’ custom state value is ‘Delete User’, and the User to delete would be the ‘User’ custom state value you set when the Delete User button was clicked.
You can also use the same conditions to display dynamic text in the popup: e.g. ‘Are you sure you want to delete this User’, or ‘Are you sure you want to delete {User’s Full Name}’. etc.
Whereas when the action is ‘delete a file’, you could display relevant text in the popup for that (i.e. ‘Are you sure you want to delete this file’).
Once the action is finished be sure to reset the custom state values to empty.
That’s the basic idea - obviously you can apply it in many different ways, and it can be simpler than that, or much more complex depending on your needs.
That way you only need to have a single popup that can handle ALL you confirmations and follow up actions.
Here’s a very simple demo example of using a single popup to confirm 4 different actions (none of these actions are touching the database in anyway, but they do refer to their own dynamic values. Obviously if you want to use the same idea to make changes to the database it’s simply a case of referring to the database items in question and assigning them in custom state values so your conditional workflow actions know which ‘Things’ to make changes to on upon confirmation).
Preview - Confirm Popup (bubbleapps.io)
Also note, in this specific example I could have just used a single action upon confirmation (due to the way I’ve set the page and content up), but I split it up into 5 actions just to demonstrate the concept. If I was deleting or changing things in the database I’d have to use separate conditional actions.