# Delete objects

The Delete objects action node deletes objects from the database or removes objects from a [runtime-only data source](/reference/apps/data/data-sources.md#database-connected-and-runtime-only-data-sources).

## Usage

This action node is used in two different contexts and the behavior has an important difference.

1. When used with a [database-connected data source](/reference/apps/data/data-sources.md#database-connected-and-runtime-only-data-sources), the object(s) are *permanently deleted* from the database. Any [delete rules](/reference/data-model/object-classes.md#data-validation) configured on object class properties will be enforced.
2. When used with a [runtime-only data source](/reference/apps/data/data-sources.md#database-connected-and-runtime-only-data-sources), the object(s) are *removed* from the data source. The database is not affected and [delete rules](/reference/data-model/object-classes.md#data-validation) are not enforced.

{% hint style="success" %}
**Best practice**

When deleting an object you should have the user confirm the action, for example by placing the Delete objects action node inside an [Open confirm dialog action node](/library/action-nodes/open-confirm-dialog.md).
{% endhint %}

#### Working with schemas

Delete Objects can target an [action variable](/reference/actions/action-variables.md) or [action param](/reference/actions/action-params.md) of type [schema](/reference/platform-concepts/schemas.md). When the target is a schema, the action node removes objects from the in-memory schema structure. Because schemas are not persisted in the database, deleting schema data does not affect stored data.

There is no selection mode for schemas. If the target schema is an array or contains a nested object, Delete Objects removes all the data in that schema.

## Properties

<table><thead><tr><th width="193">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Data Source</strong></td><td>Select a data source that contains the object(s) to delete/remove.</td></tr><tr><td><strong>Selection</strong></td><td><p><em>Available if the selected</em> <strong>Data Source</strong> <em>is a many-cardinality data source.</em><br><br>Define the objects to delete/remove.</p><ul><li><code>All objects</code></li><li><a href="/spaces/-MiLU-xcHu0eLZiTxcmZ/pages/-MiR92uc7YpwXZWPxMI1#object-selection"><code>Selected object(s)</code></a></li><li><a href="/spaces/-MiLU-xcHu0eLZiTxcmZ/pages/-MiR92uc7YpwXZWPxMI1#object-in-context"><code>Object in context</code></a></li><li><code>Filtered selection</code></li></ul></td></tr><tr><td><strong>Filter</strong></td><td><em>Available when</em> <strong>Selection</strong> <em>is Filtered selection.</em><br><br>Define the <a href="/spaces/-MiLU-xcHu0eLZiTxcmZ/pages/-MiR9GGOxcZeghNQPbzV">filter</a> to apply to the data source.</td></tr></tbody></table>


---

# 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.appfarm.io/library/action-nodes/delete-objects.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.
