Case Study

Development of a Custom Application for Data Sanitization in ServiceNow

Problem Statement:

The client had a requirement to sanitize data in their ServiceNow instances, both in production and non-production environments, in a way that all related records and data would be deleted without leaving any orphan records. The lack of this functionality in the system led to data integrity issues and posed a challenge in complying with data privacy regulations.

Solution:

To address the client's problem, we developed a custom application called "Data Sanitization" in ServiceNow. The application included a new table called "Data Sanitization request," which extended the existing Task [task] table. We added several fields to the form, such as the records to be sanitized, associated emails, approvals, histories, catalog tasks, etc.
To initiate a data sanitization request, we created a record producer that allowed users to request the sanitization of records in the Task [task] table. We then created a flow to handle the lifecycle of the data sanitization request, including notifications, approvals, and the trigger of the clean-up script actions.
The request would also trigger an API to other instances to ensure that the selected records were deleted from all ServiceNow instances. This API was triggered on creation and update of the request, and it created a request in sub-production instances as well. The flow also differentiated between production and non-production instances, ignoring approvals and notifications in non-production environments. In non-production instances, the flow directly ran the action in flow, which deleted all associated records, including attachments, approvals, histories, audit records, emails, and finally, the actual record, thereby completing the data sanitization request.
In addition to developing the custom application and table, we also created a REST API integration to create the same data sanitization request in non-production environments. We created a business rule to trigger the REST call and handle it in a way that it only triggered in the production instance, preventing the call from being triggered in non-production environments. We also created client scripts and UI policies to handle the form behaviour based on selected values and populate values based on other fields' values.

Results:

The custom application for data sanitization in ServiceNow provided the client with a reliable and efficient solution to sanitize data in their instances, ensuring data integrity and compliance with data privacy regulations. The application eliminated orphan records and related data, thereby reducing the risk of data breaches and improving the overall data quality. The integration with REST API and the ability to trigger data sanitization requests in non-production environments further streamlined the data sanitization process, saving time and effort for the client's IT team.