Delete thing and delete it from linked lists

Hello.

How do I properly remove things from the database?

Can you just delete a thing, or do you need to additionally “remove” this thing from the lists in which it is present (in another table)?

1 Like

Hi there, @kovtun… when you delete a thing, that thing is automatically removed from any lists in which it exists, so you don’t need to add workflow actions to remove it from those lists before you delete it.

Hope this helps.

Best…
Mike

1 Like

Thanks for the clarification.

I ran into a situation when, for example, such a query returns “1” even when the list is empty (visually):
2020-12-24_16-15-35

While I was able to fix it as follows:

  • before Delete Thing, I “remove” a thing from the list.
    2020-12-24_16-22-46

And since Now it is clear that the “removal” is not necessary, then the question remains, what is the cause of the problem. It seems that references to the “thing” were removed from the list, but when the last one was deleted, an empty string remained in the list. And the counter counted it and returned “1”.

Perhaps this is somehow connected with the fact that in my case the “thing” was present in two different lists.

1 Like

I just did a quick test, and I got a count of 0 on a list when the only thing in the list was removed from the list by deleting the thing itself. I wouldn’t think your result had anything to do with the thing being present in two lists because it would be deleted from both lists. It’s hard to say what could have caused the behavior you saw without seeing your exact setup and digging into it.

In other cases, everything also works for me normally, but it was in this case that I encountered such a problem. Tried everything. Only the “remove” from all lists of things before Delete Thing helped.

As for i have read till date on bubble forums the thing does not get removed from the lists at least for the purpose of count.

Did you actually test it yourself? I tested it 2 years ago and I tested it again about 2 minutes ago, and deleting a thing that is part of a list removes the thing from the list and decreases the list count by 1.