Things to Consider before Removing/Deleting your Data DescriptionThe information provided in this article details information around what to consider before a user/admin removes data from their instance. The two areas that are covered are referential data loss and cascade deletions. Referential Data Loss Reference fields in the Now Platform are dictionary-type fields that return the display value of a record based on a sys_id, and it occurs when a record is deleted from a table in which there is a reference field referencing the table. For example, A user cleaning up company records and then accidentally deletes a company record called Company ABC. Result: When this record is deleted all reference fields in the instance that had data for this company record will be set to NULL, removing all referential data in the entire instance for all fields which had sys_id value assigned to Company ABC. How to determine which reference fields will be nulled The following steps can be taken to determine what reference fields are impacted based on the example where the Company ABC record from the core_company table has been deleted. Navigate to sys_dictionary.listCreate a filter for: [Type] [is] [Reference]AND [Reference] [is] [Company]AND [Reference cascade rule] [is] [--None--]OR [Reference cascade rule] [is] [Clear]This filter will return all reference fields in the instance which are referencing the table where the record deletion occurred and identifying that the value in the field will be nulled. The provided result set indicates that each of these fields will be set to null if the value Company ABC was saved into the field.Here is an OOB example of the query: Based on the result set, we see that there are 2119 fields in sys_dictionary that could potentially be set to null given if the value 'Company ABC' is being stored in the reference fields listed. Cascade Deletions In addition to referential data Loss, there is also potential for behind the scenes cascade deletions which results in record deletion of additional records that the user/admin may not be aware of (to learn more about cascade deletions please review the following doc from our product documentation page Cascade Rules). Cascade deletions occur when cascade rules have been defined on a particular field in sys_dictionary called 'Reference cascade rule.' In the example provided above, we can run additional queries to identify if there are any cascade deletes to expect when deleting a record from the core_company table. How to determine what cascade deletions to expect Navigate to sys_dictionary.listCreate a filter for [Type] [is] [Reference]AND [Reference] [is] [Company]AND [Reference cascade rule] [is] [Delete]This filter returns all possible cascade deletions that will occur when a company record is deleted. The result set shows that there are in fact no cascade deletions when deleting a company record. A null value and a value of 'Clear' in the reference cascade rule essentially denotes that the value in these fields will just be nulled. In this case, there would only be referential data loss. Here is an example where you can expect cascade deletions: This filter shows that there are 86 possible cascade deletions that will occur if a Configuration Item (cmdb_ci) record is deleted. What users/admin should note is that a cascade deletion is essentially a spider web effect that can lead to more deletions since there can be cascade rules defined for every table where a cascade deletion has occurred. Users/Admin should be absolutely careful when removing data from their instances and if data removal is required this should always be tested in a sub-production environment before deletions are made on a production instance. It is important for the user/admin to review the possible effects of deletion before performing such actions.