The CreatorCon Call for Content is officially open! Get started here.

How to get all information from the History Table (and archived information)

Julien Tessier
Kilo Contributor

Hello,

Currently I am working on an application that reads data from Service Now. I have a ODBC connection that is working and I am currently trying to get the information from the History table (sys_history_line) so I can get all the data from one type of entrance. The isssue I am having is that this table dosen't have all the data that I need. While going to look the table, I noticed some entranced that I did a couple of months ago were not in the table, but when I went to look in the task related to those entrances in service now, they were then re-added into Service Now.

This makes me think that the information is archived somewhere. Is there a way to go get the information that was archived for that table? 

Thank you

1 ACCEPTED SOLUTION

adamjgreenberg
ServiceNow Employee
ServiceNow Employee

Julien,

 

sys_history_line is on table rotation by default in most out of box instances. This means that there is only limited data available at any one time to maintain good instance performance.

These tables have four rotations and are rotated every seven days. Our platform truncates the leading table in rotation, so at best you will have a maximum of 21 days of history available at any one time. This is why the data you're looking for likely no longer exists.

 

Additionally, sys_history_line is built from sys_audit as the data is called by the users.

 

You can query sys_audit directly, but I will warn you this may cause performance issues and could time out depending on how much data you are requesting to view.

 

Is this something you could create with a scheduled report?

 

View solution in original post

2 REPLIES 2

adamjgreenberg
ServiceNow Employee
ServiceNow Employee

Julien,

 

sys_history_line is on table rotation by default in most out of box instances. This means that there is only limited data available at any one time to maintain good instance performance.

These tables have four rotations and are rotated every seven days. Our platform truncates the leading table in rotation, so at best you will have a maximum of 21 days of history available at any one time. This is why the data you're looking for likely no longer exists.

 

Additionally, sys_history_line is built from sys_audit as the data is called by the users.

 

You can query sys_audit directly, but I will warn you this may cause performance issues and could time out depending on how much data you are requesting to view.

 

Is this something you could create with a scheduled report?

 

Julien Tessier
Kilo Contributor

This is exactly what I was searching for. Because I am filtering the data that I am getting, I can work with this. Thank you