This article is meant to help clarify how to use 'Table Cleaner' to delete unwanted data in ServiceNow.

Table cleaner does not impact performance as it cleans the data in batches.

This currently applies to only instances running with MySQL/MariaDB database and cannot be used for sharded tables of table rotation and table extension.


The following instructions outline the creation of a new 'Table Cleaner'

  1. Navigate to 'System Maintenance > Table Cleanup' (These are labelled as Auto Flushes)
  2. Click on 'New' and a screen will be displayed as per the following attached screenshot
  3. Based upon the clean up requirements fill in the following fields accordingly
      1. Table Name - Identify Table Name to be cleaned
      2. Matchfield - Field based on which records will be cleaned e.g. sys_created_on
      3. Age in seconds - How old records to be deleted - Enter the number in seconds - 2592000 for 30 days old records. Enter 0 in seconds if you want to delete all the records for specified condition as specified in 'Conditions'
      4. Active - Check the checkbox to active
      5. Application - This will be greyed out
      6. Cascade delete – Check the check box to delete cascade relationships to the table
      7. Conditions - Add the specified filter condition or do not add it if all the records related of certain age needs to be deleted as specified in 'Age in seconds'
  4. Click 'Submit' and the record will be created. On the next execution of the "Table Cleaner' job this new rule will be executed

Article Information

Last Updated:2020-01-29 08:36:21