# How to: Delete a thing

To delete a thing we need to be able to target it correctly. The Delete a thing action actually works for multiple things, so based on the filter you setup it will target one of more entries to delete.&#x20;

<figure><img src="/files/JWqG8S9cf0UFTsclZJvA" alt=""><figcaption></figcaption></figure>

Here we have try to delete a post based on Unique ID, so we target it with the filter. This way, since the Unique ID is by definition is unique it will target this single entry.&#x20;

Let's look at a different scenario:

<figure><img src="/files/eJ66YRkFXd4ahJCPrlyf" alt=""><figcaption></figcaption></figure>

Now in this example we target the Title, which is not unique and can be multiple entries of the same name. The action will delete all of those

{% hint style="warning" %}
Please double check you always target the relevant things.
{% endhint %}

Note on Cascade delete: You can setup your Database to delete entries when a referenced field is being deleted.&#x20;

As previously mentioned and shown in examples, we can setup a Database structure where a table called "post" has a foreign key relation to "Category" table. Which means we can reference and filter based on each other and do some complex things.&#x20;

However let's say when you remove a "Category" you'd like to remove all the "post" related. In this case we don't have to setup complex workflows to remove all those rows we can let Supabase remove them for us automatically.

<figure><img src="/files/esT5XASDzAu6SBNtoayr" alt=""><figcaption></figcaption></figure>

This is mostly useful when you have a very interconnected system, and maybe you'd like to remove everything which the "User" have been attached, all you need to remove is the "User" after that everything else will happen like a waterfall and all records will be deleted which references that "User"


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.relevat.hu/supabase.js-bubble-plugin/setup/supabase-data/how-to-delete-a-thing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
