Help with delete thing logic

Hello everyone. Faced such a simple task as deleting a thing from the database via a backend workflow, but I can’t solve it in any way.

I have a main data type called Company, and several data fields that are texts, List of Documents, Lists of Related Data Types, etc that I want to delete when I delete the parent thing, the Company. The problem is that I don’t know how to arrange this workflow, although it would seem super simple.

The backend workflow is triggered when the delete button is clicked, then "Delete 1st thing (parent’s group company before change’s related task)”* Bubble doesn’t consider the input valid, as shown bellow:

image

It doesn’t let me just leave the entry delete to "Company Before Change’s related task” or “address” or “documents”, and it requires to continue using one of the options shown in the screenshot (it varies depending on the field type):
image

How should the workflow be built so that when the button is clicked, the backend workflow will delete the related data field / related data types from the database?

That’s because you are using “Delete a list of Companies” and put Company as the type. You should change it to Documents/related data types and use your Company as a search constraint in list to delete field…

1 Like

So simple! Thank you so much @artemzheg!

1 Like