Deleting records in Bubble uses the Delete a Thing action for single records and Schedule API Workflow on a List for bulk deletions. This tutorial covers safe deletion patterns including soft delete with a flag, cascading related records, bulk delete operations, and undo functionality.
Overview: Deleting Database Records in Bubble
Deletion is permanent in Bubble — there is no undo or recycle bin. This makes it critical to implement safe deletion patterns. This tutorial covers single and bulk deletion, soft delete alternatives, and handling related records.
Prerequisites
- A Bubble app with Data Types containing records
- Understanding of Bubble workflows and data relationships
- Backend workflows enabled for bulk operations (Starter+)
Step-by-step guide
Delete a single record with Delete a Thing
Delete a single record with Delete a Thing
In a workflow, add the action Data → Delete a Thing. Set the Thing to delete using the appropriate context: Current cell's DataType in a Repeating Group, a search result :first item, or a result from a previous step. Bubble permanently removes the record. Add a confirmation step before deletion — show an Alert or Popup asking Are you sure you want to delete this? with Confirm and Cancel buttons.
Pro tip: Always add a confirmation dialog before deletion. Accidental deletions cannot be undone in Bubble.
Expected result: The selected record is permanently removed from the database after user confirmation.
Implement soft delete instead of hard delete
Implement soft delete instead of hard delete
Soft delete marks a record as deleted without actually removing it. Add a field called deleted (yes/no, default: no) to your Data Type. Instead of Delete a Thing, use Make Changes to Thing and set deleted to yes. Update all your searches to include deleted = no as a constraint. This lets you restore accidentally deleted records and maintain historical data.
Expected result: Records are flagged as deleted but remain in the database for potential recovery.
Handle cascading deletions of related records
Handle cascading deletions of related records
When you delete a parent record (e.g., a Project), related child records (e.g., Tasks, Comments) still exist as orphans. Before deleting the parent, search for all related records and delete them first. Create a workflow that: (1) Searches for all child records referencing the parent. (2) Deletes each child record. (3) Deletes the parent record. For multiple child types, delete them in the correct order.
Expected result: Deleting a parent record also removes all related child records, preventing orphaned data.
Bulk delete records with Schedule API Workflow on a List
Bulk delete records with Schedule API Workflow on a List
For deleting many records at once, create a backend API workflow called delete-single-record that takes a Thing parameter and deletes it. In your frontend workflow, use Schedule API Workflow on a List with the list set to your search results and the workflow set to delete-single-record. This processes each deletion server-side without freezing the browser.
Expected result: Large numbers of records are deleted reliably via background processing.
Add undo functionality with temporary soft delete
Add undo functionality with temporary soft delete
For a better user experience, implement a temporary undo window. When the user clicks Delete, set deleted = yes and show a toast notification with an Undo button that sets deleted back to no. Use a Do When Condition Is True or scheduled workflow to hard-delete the record after 10 seconds if the user does not click Undo.
Expected result: Users have a brief window to undo deletions before they become permanent.
Complete working example
1DELETION PATTERNS SUMMARY2==========================34PATTERN 1: Hard Delete (single record)5 Workflow: Delete button clicked6 1. Show Popup: ConfirmDelete7 2. Confirm button: Delete a Thing → Current cell's Record89PATTERN 2: Soft Delete10 Data Type field: deleted (yes/no, default: no)11 Delete workflow: Make Changes → deleted = yes12 All searches: add constraint deleted = no13 Restore: Make Changes → deleted = no14 Cleanup: Backend workflow periodically hard-deletes records where deleted = yes AND Modified Date < 30 days ago1516PATTERN 3: Cascading Delete17 Workflow: Delete Project button clicked18 1. Schedule API on List: Search Tasks (project = This Project)19 → delete-single-task workflow20 2. Schedule API on List: Search Comments (project = This Project)21 → delete-single-comment workflow22 3. Delete a Thing: This Project23 (Order matters: delete children before parent)2425PATTERN 4: Bulk Delete26 Backend workflow: delete-single-record27 Parameter: record (DataType)28 Action: Delete a Thing → record29 Frontend workflow:30 Schedule API Workflow on a List:31 List: Search for Records (condition)32 Workflow: delete-single-record3334PATTERN 5: Undo Delete35 1. Make Changes → deleted = yes, deleted_at = Now36 2. Show toast: "Deleted. [Undo]"37 3. Undo click: Make Changes → deleted = no38 4. Scheduled cleanup: Delete things where deleted=yes AND deleted_at < 10 seconds agoCommon mistakes when deleting database things in Bubble
Why it's a problem: Deleting records without a confirmation dialog
How to avoid: Always show a confirmation popup or dialog before executing the Delete a Thing action
Why it's a problem: Not deleting related child records before the parent
How to avoid: Search for and delete all related child records before deleting the parent record
Why it's a problem: Using Delete a List of Things from the frontend for large datasets
How to avoid: Use Schedule API Workflow on a List for bulk deletions of 100+ records
Best practices
- Always add a confirmation step before permanent deletion
- Consider soft delete for critical data to enable recovery
- Delete related child records before parent records to prevent orphans
- Use Schedule API Workflow on a List for bulk deletions
- Add a temporary undo window for better user experience
- Implement a cleanup workflow that periodically hard-deletes old soft-deleted records
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I need to implement safe deletion in my Bubble.io app. I want soft delete for important records, cascading deletion for related records, bulk delete capability, and a brief undo window. Can you outline the patterns and workflows?
Set up safe deletion for my app. I need a soft delete system with an undo window, cascading deletion for Projects and their Tasks, and a bulk delete option for admin users.
Frequently asked questions
Can I recover a permanently deleted record?
No. Once you use Delete a Thing in Bubble, the record is permanently removed. There is no recycle bin or undo feature. This is why soft delete is recommended for important data.
Does deletion free up storage?
Deleting records frees database storage, but files (images, documents) associated with deleted records remain in the File Manager until manually deleted.
How much does a deletion cost in WUs?
A single Delete a Thing costs approximately 0.5 WU. Bulk deletions via Schedule API Workflow cost WUs per record.
Can I delete records via the Data API?
Yes. Send a DELETE request to https://yourapp.bubbleapps.io/api/1.1/obj/datatype/uniqueid with proper authentication.
What happens to fields referencing a deleted record?
Fields that referenced the deleted record become empty. Searches that included the record no longer return it. Custom states holding the deleted record still reference it until the page reloads.
Can RapidDev help with data management architecture?
Yes. RapidDev has built data management systems in Bubble including archival workflows, audit trails, cascading operations, and GDPR-compliant data deletion processes.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation