I want to create a button that will delete any rows which have broken relations in any of their columns, but I don’t know how to write that as a formula.
For context:
I have a table called Projects with a two-way relation to a table called Tasks. When I delete a project, the tasks still exist, but their “project” column now references a project that has been deleted. How can I create a button that will search for any of these orphaned tasks and delete them? TIA
Not exactly what you asked for, but I think the best option would be to implement a delete button on the projects table.
The delete button would have a RunActions formula, and you would run two actions. The first one would delete any tasks rows where the project is equal to this row (the current project opened), then the second action would delete this row (the actual project).
This would make it so you cleanly delete the project and it’s tasks, leaving you with no orphaned tasks!
Thank you @Micah_Lucero ! I thought about that but figured sooner or later someone’s just going to accidentally delete the row directly instead of using the button haha. If there’s no other solution, this is probably what I’ll end up doing.