Some records are created in Record History (sys_history_set) table and some in sys_audit table

Hari1
Mega Sage

Hi,

 

I see some records are created in Record History (sys_history_set) table and some in sys_audit table. How do i create records in sys_history_set table?
Can anyone explain how are Record History (sys_history_set) table sys_audit table different?

 

Thanks

3 REPLIES 3

Robert H
Mega Sage

Hello @Hari1 ,

This article should answer your questions.

Regards,

Robert

Ankur Bawiskar
Tera Patron
Tera Patron

@Hari1 

The Audit [sys_audit] and History Sets capture the same data, but data is managed differently. The major difference between them is persistence:

    • The Audit table [sys_audit] records persist forever.
    • The History Set [sys_history_set] records are generated on use and are removed by the table cleaner 30 days after their most recent use.

good explanation here

Auditing and history sets | How they work together 

Differences Between Audit and History Sets 

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

Hi Ankur,
I see some of the field in sys_audit table and some field stored in sys_history_set table.

Hari1_0-1743159078034.png

I need to bring the Audit (sys_audit) records on the Form Layout. How can i get that?