---
schema_version: "1"
id: 4082d595bda3e5f2837c69583e166ef341e2f2af56f535bc29057e4e69dad758
title: Delete an Object Record from an Omniscript
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_delete_action_11946.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_delete_action_11946.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ec05981f6210a25fce09c411b34ec26183f50e3df054ece0f07ffce2b91cd1f3
description: Enable users to delete one or more sObject records by using the Delete Action. Use an Object's Record Id to determine which record to delete. The best practice is to use a merge field to refer to an Id or a list of IDs in the data JSON.
products:
  - Omnistudio
release: "264"
---
# Delete an Object Record from an Omniscript

Enable users to delete one or more sObject records by using the Delete Action. Use an Object's Record Id to determine which record to delete. The best practice is to use a merge field to refer to an Id or a list of IDs in the data JSON.

1. Preview the Omniscript and identify the JSON path for the record.
    
    For example, this data JSON contains a list of accounts.
    
      `{     "Account": [       {         "accId": ["001f400000EPQ8o", "001f400000BAkbn"]       }     ]   }`
2. In the Delete Action properties, click **Add sObject to Delete**.
    1. From the Type of sObject dropdown, select an Object.
    2. In the Path to Id field, enter the JSON path for the record id using merge field syntax.
        
        Using the Account example, the path to delete the array of Account ids is: `%Account:accId%`.
    3. If required, select **Fail operation if any records aren’t deleted**.
        
        In the designer for a managed package, the check box is **All or None**.
3. Enable users to confirm the deletion of a record by configuring these fields in the Confirmation Modal section:
    1. To display a confirmation modal before deleting the record, select **Display confirmation modal**.
        
        In the designer for a managed package, select **Confirm**.
    2. Enter the message to be displayed in the confirmation modal.
    3. If necessary, provide button labels for confirm and cancel actions.
4. Display messages when the operation succeeds or fails by configuring these fields in the Error Messages section:
    1. In the **Deleted Record Message** field, enter a message that displays when a record is deleted.
        
        In the designer for a managed package, enter the message in the **Entity Is Deleted Message** field.
    2. In the **Invalid ID Message** field, enter a message that displays when an invalid Id is sent to the Delete Action.
    3. In the **Deletion Failed Message** field, enter a message that displays when the action fails to delete a record.
    4. In the **Configuration Error Message** field, enter a message that displays when the Delete Action has a configuration error.