{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":32595,"path":"it-service-management/digital-experience-score/dexscr-delete-demo-data.md","title":"Delete Digital Experience Score​ demo data","bundle":null,"doc_type":null,"release":"australia","body":"\n# Delete Digital Experience Score​ demo data\n\nDelete the demo data for Digital Experience Score​ when you no longer need it.\n\n## Before you begin\n\n[Install Digital Experience Score​](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/digital-experience-score/install-dex-score.md)\n\nRole required: admin\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Definition** &gt; **Scheduled Jobs**.\n\n2.  Find and open the **DeleteAggregatedDemoDataDexScore** scheduled job.\n\n3.  Select **Execute Now**.\n\n    The job runs in the background.\n\n4.  Verify the completion status of the scheduled job.\n\n    1.  Access the Pending Scheduled Jobs and Running Scheduled Jobs tables.\n\n        -   Pending Scheduled Jobs: Navigate to **All** &gt; **System Diagnostics** &gt; **Pending Scheduled Jobs**.\n        -   Running Scheduled Jobs: Navigate to **All** &gt; **System Diagnostics** &gt; **Running Scheduled Jobs**.\n    2.  Verify that the **DeleteAggregatedDemoDataDexScore** job isn’t listed in either of the tables.\n\n5.  Navigate back to the scheduled jobs list.\n\n6.  Find and open the **DeleteDemoDataDexScore** scheduled job.\n\n7.  Select **Execute Now**.\n\n    The job runs in the background.\n\n8.  Verify that the **DeleteDemoDataDexScore** job isn’t listed in the Pending Scheduled Jobs and Running Scheduled Jobs tables.\n\n9.  Delete records that are in the global scope.\n\n    1.  Navigate to **All** &gt; **System Definition** &gt; **Scripts - Background**.\n\n    2.  Enter the deletion script in the **Run script \\(JavaScript executed on server\\)** field.\n\n        ```\n        var prefix = \"[DEXScore Demo]\";\n               //Deleting computer records\n               var comp = new GlideRecord('cmdb_ci_computer');\n              comp.addEncodedQuery('nameSTARTSWITH' + prefix);\n               comp.query();\n               comp.deleteMultiple();\n               //Deleting User Records\n               var userGR = new GlideRecord(\"sys_user\");\n              userGR.addEncodedQuery('nameSTARTSWITH' + prefix);\n               userGR.query();\n               userGR.deleteMultiple();\n               //Deleting CMN Location Records\n               var location = new GlideRecord('cmn_location');\n              location.addEncodedQuery('nameSTARTSWITH' + prefix);\n               location.query();\n               location.deleteMultiple();\n        ```\n\n    3.  If the default value for the **in scope** field is not set to **global**, select **global** from the drop-down list.\n\n    4.  Select **Run Script**.\n\n\n## Result\n\nAfter both scheduled jobs run successfully and the script to delete records in global scope executes, the demo data is deleted from the instance.\n\nIf an error occurs during execution of the scheduled jobs, run the jobs again.\n\n**Parent Topic:**[Install Digital Experience Score​](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/digital-experience-score/install-dex-score.md)\n\n**Related topics**  \n\n\n[Load Digital Experience Score​ demo data]()\n\n"}}