<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to retrieve sys_history_line records for a specific record? in Platform Analytics forum</title>
    <link>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3513909#M64115</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/806008"&gt;@NAVAYUVANS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Audit [sys_audit] and History Sets capture the same data, but data is managed differently. The major difference between them is persistence:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Audit table&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN&gt;sys_audit&lt;/SPAN&gt;] records persist forever.&lt;/LI&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;History Set&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN&gt;sys_history_set&lt;/SPAN&gt;] records are generated on use and are removed by the table cleaner 30 days after their most recent use.&lt;/LI&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;History Set Line&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN&gt;sys_history_line&lt;/SPAN&gt;] records are on four tables that are managed using Table Rotation, which is customizable. From the base system, the tables are rotated on a seven-day basis, meaning that the records are dropped 28 days after generation unless they are requested again.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Once you Open the record -&amp;gt; right-click on the header or the hamburger menu icon-&amp;gt;select History from the menu-&amp;gt;List : History set and history line records will be generated from the sys_audit table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer following KBs:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0744473" target="_self"&gt;History sets - How are they generated&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0547662" target="_self"&gt;KB0547662:Auditing and history sets | How they work together&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/how-to-fix-deleted-record/m-p/3474488" target="_blank"&gt;https://www.servicenow.com/community/developer-forum/how-to-fix-deleted-record/m-p/3474488&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2026 17:48:31 GMT</pubDate>
    <dc:creator>Tanushree Maiti</dc:creator>
    <dc:date>2026-03-24T17:48:31Z</dc:date>
    <item>
      <title>How to retrieve sys_history_line records for a specific record?</title>
      <link>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3513901#M64114</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;I have a question regarding retrieving records from the &lt;STRONG&gt;sys_history_line&lt;/STRONG&gt; table.&lt;/P&gt;&lt;P&gt;In my scenario, a record was created and updated a long time ago. Over time, the related entries in &lt;STRONG&gt;sys_history_line&lt;/STRONG&gt; were deleted. However, when I open the record again or navigate to &lt;STRONG&gt;History → List&lt;/STRONG&gt;, the system regenerates the history lines, and I’m able to fetch that data using a background script.&lt;/P&gt;&lt;P&gt;My requirement is to retrieve those &lt;STRONG&gt;sys_history_line&lt;/STRONG&gt; records &lt;STRONG&gt;without opening the record or navigating to the History UI&lt;/STRONG&gt;, i.e., without triggering regeneration manually.&lt;/P&gt;&lt;P&gt;Is there a way to access or regenerate these history records programmatically?&lt;/P&gt;&lt;P&gt;Any guidance would be appreciated. Thanks&amp;nbsp;in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 17:33:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3513901#M64114</guid>
      <dc:creator>NAVAYUVANS</dc:creator>
      <dc:date>2026-03-24T17:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve sys_history_line records for a specific record?</title>
      <link>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3513909#M64115</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/806008"&gt;@NAVAYUVANS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Audit [sys_audit] and History Sets capture the same data, but data is managed differently. The major difference between them is persistence:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Audit table&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN&gt;sys_audit&lt;/SPAN&gt;] records persist forever.&lt;/LI&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;History Set&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN&gt;sys_history_set&lt;/SPAN&gt;] records are generated on use and are removed by the table cleaner 30 days after their most recent use.&lt;/LI&gt;&lt;LI&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;History Set Line&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;[&lt;SPAN&gt;sys_history_line&lt;/SPAN&gt;] records are on four tables that are managed using Table Rotation, which is customizable. From the base system, the tables are rotated on a seven-day basis, meaning that the records are dropped 28 days after generation unless they are requested again.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Once you Open the record -&amp;gt; right-click on the header or the hamburger menu icon-&amp;gt;select History from the menu-&amp;gt;List : History set and history line records will be generated from the sys_audit table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer following KBs:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0744473" target="_self"&gt;History sets - How are they generated&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0547662" target="_self"&gt;KB0547662:Auditing and history sets | How they work together&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/how-to-fix-deleted-record/m-p/3474488" target="_blank"&gt;https://www.servicenow.com/community/developer-forum/how-to-fix-deleted-record/m-p/3474488&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 17:48:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3513909#M64115</guid>
      <dc:creator>Tanushree Maiti</dc:creator>
      <dc:date>2026-03-24T17:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve sys_history_line records for a specific record?</title>
      <link>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3514518#M64132</link>
      <description>&lt;P class=""&gt;&lt;SPAN&gt;Thanks &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/287542"&gt;@Tanushree Maiti&lt;/a&gt; for your response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please clarify how the &lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;sys_history_set&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;sys_history_line&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN&gt; records are generated in the backend? I’d like to understand the mechanism so I can implement a similar approach and retrieve the data to display on the Service Portal side.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 13:46:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3514518#M64132</guid>
      <dc:creator>navayuvan29</dc:creator>
      <dc:date>2026-03-25T13:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve sys_history_line records for a specific record?</title>
      <link>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3514519#M64133</link>
      <description>&lt;P class=""&gt;&lt;SPAN&gt;Thanks &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/287542"&gt;@Tanushree Maiti&lt;/a&gt; for your response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please clarify how the [&lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;sys_history_set ]&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN&gt; and [&lt;/SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;sys_history_line]&lt;/SPAN&gt;&lt;/CODE&gt;&lt;SPAN&gt; records are generated in the backend? I’d like to understand the mechanism so I can implement a similar approach and retrieve the data to display on the Service Portal side.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 13:52:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3514519#M64133</guid>
      <dc:creator>NAVAYUVANS</dc:creator>
      <dc:date>2026-03-25T13:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve sys_history_line records for a specific record?</title>
      <link>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3514670#M64140</link>
      <description>&lt;P&gt;In ServiceNow, records in the &lt;STRONG&gt;sys_history_set&lt;/STRONG&gt; and &lt;STRONG&gt;sys_history_line&lt;/STRONG&gt; tables are not stored permanently; they are generated dynamically when a user accesses a record’s history. The system constructs these entries on demand by processing raw audit data from the &lt;STRONG&gt;sys_audit&lt;/STRONG&gt; table, presenting it as a clear, chronological, and user-friendly view of changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ref:&amp;nbsp;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0744473#:~:text=To%20avoid%20generating%20a%20new,the%20sys_history_set%20and%20sys_history_line%20tables" target="_blank" rel="noopener"&gt;https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0744473#:~:text=To%20avoid%20generating%20a%20new,the%20sys_history_set%20and%20sys_history_line%20tables&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/regenerating-sys-history-line-and-sys-history-set-with-updated/m-p/1716948#:~:text=Here's%20some%20information%20about%20regenerating%20sys_history_line%20and,*%20Re%2Dgenerate%20the%20history%20for%20the%20case" target="_blank" rel="noopener"&gt;https://www.servicenow.com/community/developer-forum/regenerating-sys-history-line-and-sys-history-set-with-updated/m-p/1716948#:~:text=Here's%20some%20information%20about%20regenerating%20sys_history_line%20and,*%20Re%2Dgenerate%20the%20history%20for%20the%20case&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 16:45:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/platform-analytics-forum/how-to-retrieve-sys-history-line-records-for-a-specific-record/m-p/3514670#M64140</guid>
      <dc:creator>Tanushree Maiti</dc:creator>
      <dc:date>2026-03-25T16:45:09Z</dc:date>
    </item>
  </channel>
</rss>

