Bulk update function logs or back out

Brad Warman
Giga Sage

Hi. One of our staff completed a bulk update of records on the alm_hardware table using the bulk update function but it appears to have updated unintended records. Is there a way to either see logs related directly to this bulk update to identify impacted records, or back out the bulk update entirely? 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Brad Warman 

if you know the time when it was done, you can check the import logs

AnkurBawiskar_1-1736855878134.png

 

also alm_hardware table is audited so you can check that table and add proper condition for the person and time, the document key column will give you the record sysId

 

AnkurBawiskar_0-1736855858949.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Runjay Patel
Giga Sage

Hi @Brad Warman ,

 

If you have many records to update, use a Background Script to programmatically revert changes:

var gr = new GlideRecord('alm_hardware');
gr.addQuery('sys_updated_by', 'staff_username'); // Replace with the username
gr.addQuery('sys_updated_on', '>=', 'YYYY-MM-DD HH:mm:ss'); // Approximate time
gr.query();

while (gr.next()) {
    gr.field_name = gr.getAuditValue('field_name', 'before'); // Replace with actual field name
    gr.update();
}

 

Also check this table sys_update_xml, ServiceNow logs changes made by bulk updates in this table.

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

Hi @Runjay Patel. Where are you getting the gr.getAuditValue method from? I can't see that in the ServiceNow Developer documentation as a valid method for the Gliderecord API. It also returns undefined when I attempt to use it in my script.

Ankur Bawiskar
Tera Patron
Tera Patron

@Brad Warman 

if you know the time when it was done, you can check the import logs

AnkurBawiskar_1-1736855878134.png

 

also alm_hardware table is audited so you can check that table and add proper condition for the person and time, the document key column will give you the record sysId

 

AnkurBawiskar_0-1736855858949.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Brad Warman 

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader