# Delete objects

The Delete objects action node deletes objects from the database or removes objects from a [runtime-only data source](https://docs.appfarm.io/reference/apps/data/data-sources#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](https://docs.appfarm.io/reference/apps/data/data-sources#database-connected-and-runtime-only-data-sources), the object(s) are *permanently deleted* from the database. Any [delete rules](https://docs.appfarm.io/reference/data-model/object-classes#data-validation) configured on object class properties will be enforced.
2. When used with a [runtime-only data source](https://docs.appfarm.io/reference/apps/data/data-sources#database-connected-and-runtime-only-data-sources), the object(s) are *removed* from the data source. The database is not affected and [delete rules](https://docs.appfarm.io/reference/data-model/object-classes#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](https://docs.appfarm.io/library/action-nodes/open-confirm-dialog).
{% endhint %}

## 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="../../../reference/platform-concepts/objects#object-selection"><code>Selected object(s)</code></a></li><li><a href="../../../reference/platform-concepts/objects#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="../../reference/platform-concepts/filters">filter</a> to apply to the data source.</td></tr></tbody></table>
