Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Retrieve Previously Changed Data in ServiceNow

22M61A05D8
Tera Contributor

Hi everyone,

I accidentally updated some records in the Incident table using a GlideRecord script. Now, I want to retrieve the previous values of those records before they were changed.

Questions:

Is there a way to get the old values of a record after it has been updated?

Can I use Audit History or any GlideRecord script to retrieve the previous data?

Are there best practices to track and restore changed data in ServiceNow?

Any guidance or examples would be really helpful.

Thanks

1 REPLY 1

J Siva
Kilo Patron
Kilo Patron

Hi @22M61A05D8 
1. If you want to revert the changes you made, you can roll back your script execution from the Script Execution History. â€˜Record for rollback’ checkbox must be selected when you run the script; otherwise, this feature will not work.

JSiva_0-1761024108230.png

 

2. You can use a GlideRecord script to retrieve the previous value of a specific field, but there is one condition: the field must not have been updated after you made the changes. Otherwise, you need to manually review the Audit history.

Regards,
Siva