---
sourceDocument: Australia ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/platform-administration

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Create a cleanup rule

# Create a cleanup rule {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read  
Define a rule for deleting records from a primary table on a recurring basis.{#dmc-create-cleanup-rule__patch-rn-ap4-1}

## Before you begin

Role required: admin

## About this task

Create a cleanup rule to delete records on a recurring basis. To delete records as a one-time operation, see [Create a one-time delete rule](https://servicenow-prod.fluidtopics.net/vmPH46SN44FEBcUKQwPBOA#dmc-create-onetime-delete-rule "Define a rule for deleting records now or at a later date.").

## Procedure

1. Access the create rule wizard in the Data Management Console in one of the following ways.

   | Option | Steps |
   | Overview tab | 1. Navigate to AllSystem Data ManagementData Management Console. 2. On the Overview tab, select the table with records that you want to clean up. 3. Select Create rule. {#dmc-create-cleanup-rule__ol_fp3_ffm_13c} |
   | Rules tab | 1. Navigate to AllSystem Data ManagementData Management Console. 2. On the Tables tab, select the table with records that you want to clean up. 3. On the table details page, select the Rules tab. 4. Select Create rule. {#dmc-create-cleanup-rule__ol_fpz_ffm_13c} |
   |-|-|

   {#dmc-create-cleanup-rule__choicetable_snz_r2m_13c}
2. Define the cleanup rule.
   1. On the Define your rule page, select Cleanup as the rule type.
   2. Enter a name and description for the rule.  
      The name is used as the [display value](https://servicenow-prod.fluidtopics.net/KGaZp~Tv~~ETyiztMAWpjg "Reference fields store a sys_id for each referenced record in the database, but the sys_id is not shown.") for references to this rule.
   3. Select Save and continue.
   {#dmc-create-cleanup-rule__substeps_bxd_dgm_13c}

## Define cleanup rule conditions {#ariaid-title2}

Define one or more conditions that identify the records to be deleted.{#dmc-define-cleanup-conditions__patch-rn-ap4-1}

### Before you begin

Role required: admin

### About this task

Use the condition builder to specify filter conditions that define the records to be deleted. For example, you might specify that only records where 'active = false AND state =closed' are deleted.

### Procedure

1. On the Define conditions page, select the Date/Time field that you want to use for monitoring duration in the Date field.
2. Specify the amount of time that the system must wait before deleting records by entering a duration (in years, days, and hours).
3. Limit the number of records by adding one or more conditions that records must meet.
   1. Select a field, operator, and field value.  
      For example, \[Active\] \[is\] \[false\].
   2. **Optional:** Use the OR and AND operators to add conditions.
   3. **Optional:** Select Add condition set Criteria to add another set of conditions.
   {#dmc-define-cleanup-conditions__substeps_zvp_sts_13c}
4. Select Save and continue.
{#dmc-define-cleanup-conditions__steps_yvp_sts_13c}

## Select associated records to delete {#ariaid-title3}

Specify which associated records to delete when the cleanup rule runs.{#dmc-identify-associated-records-delete__patch-rn-ap4-1}

### Before you begin

Role required: admin

### Procedure

1. On the Clean up associated records page, select which associated records to delete when the cleanup rule runs.

   | Associated records | Description |
   | Attachments | Selected by default. Associated attachments are always deleted. |
   | Journals | If selected, related records in the Journal Entry \[sys_journal_field\] table are also deleted. If cleared, the system deletes records from the target table, but not any related journal records in this table. |
   | Audits | If selected, related records in the following audit tables are also deleted: * Sys Audit \[sys_audit\] table * Audit Relationship Change \[sys_audit_relation\] table {#dmc-identify-associated-records-delete__ul_szv_fxh_4xb} Note: Audit records that are created by table cleaner in the Audit Deleted Record \[sys_audit_delete\] table are preserved. If cleared, the system deletes records from the target table, but not any related audit records in these tables. |
   |-|-|

   {#dmc-identify-associated-records-delete__choicetable_vlk_yvs_13c}
2. **Optional:** Delete all matching records plus any records referring to them by selecting Cascade delete.  
   If this option is cleared, the system deletes matching records, but not records referring to them.
3. Select Save and continue.

## View a summary of your cleanup rule and activate it {#ariaid-title4}

View a summary of your cleanup rule and decide whether to activate it.{#dmc-activate-cleanup-rule__patch-rn-ap4-1}

### Before you begin

You must activate the cleanup rule and its corresponding data management policy for the cleanup rule to run.

Role required: admin

### Procedure

1. On the Rule summary page, review the cleanup rule conditions and settings.
2. **Optional:** Activate the rule by selecting Activate the rule upon creation.

### Result

The table cleanup rule runs automatically and deletes records when they meet the specified record age and any conditions that you set for them.

*[\>]: and then


