# Delete Records

This action will delete one or more records from a given collection by using a supplied unique id or a filter.

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

### Settings

The action uses the following settings:

| Setting          | Description                                                                                                                                                     | [Parsed](/actions-and-operations/dynamic-parsing.md) |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| Bot              | The bot that is providing collection access. The current bot is selected by default.                                                                            | :no\_entry:                                          |
| Collection       | The collection to be used for the action                                                                                                                        | :no\_entry:                                          |
| Record Unique Id | The unique id of the record to be deleted. If left empty,[ Filter Operations](/actions-and-operations/database/set-field-filter-value.md) will be used instead. | :white\_check\_mark:                                 |

### Remarks

If no unique id is specified, this action will delete all records that satisfy the given filters. Records are physically deleted from the collection with no way to retrieve them.

If no unique id and not filters are specified, the action won't execute.

### Trigger

If no unique id is specified, this action will trigger [all filters](/actions-and-operations/database/set-field-filter-value.md) added as operations.

### Variables

This action produces the following variables after being triggered:

| Variable                       | Description                                                                         |
| ------------------------------ | ----------------------------------------------------------------------------------- |
| last\_database\_command\_count | Contains the number of records that have been deleted from the selected collection. |

### Availability

Channel specific availability follows the table below:

| Channel          | Availability     |
| ---------------- | ---------------- |
| Facebook         | Fully Available. |
| WhatsApp         | Fully Available. |
| SMS              | Fully Available. |
| Telegram         | Fully Available. |
| Web              | Fully Available. |
| Alexa            | Fully Available. |
| Google Assistant | Fully Available. |
| Slack            | Fully Available. |
| API              | Fully Available. |

This action requires an active [Database ](broken://pages/-LdYpe93z-UqrvvQdX7V)package.


---

# 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.mylinkconnect.com/actions-and-operations/database/delete-records.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.
