- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2025 04:10 PM
Hi Community,
I'm working on a time series chart to visualize the CMDB Health trend (covering Completeness, Correctness, and Compliance) over the past 6 to 12 months, broken down by CMDB Groups.
Currently, I'm using data from the following tables:
cmdb_health_scorecard_group
cmdb_health_result_group_map
However, these tables only seem to retain data for the last 1–2 months.
My questions:
Is there a way to retrieve historical data (6–12 months) from these or other related tables?
If historical data is not retained in these tables, are there alternative tables or best practices for storing or archiving CMDB health scores over time?
Has anyone implemented a custom solution (e.g., scheduled jobs, data snapshots, or reporting tables) to track long-term CMDB health trends?
Any guidance or suggestions would be greatly appreciated!
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:34 AM
Hi @jessicahuan ,
Great question!
This is a very common challenge when building long-term trend reports for CMDB Health in ServiceNow, because by default the CMDB Health data tables are optimized for recent data and don’t store deep history.
Here’s a detailed solution as per my understanding and some practical recommendations:
1. Why your tables only have limited data:
The tables you’re using —
* cmdb_health_scorecard_group
* cmdb_health_result_group_map
— store results only from the last couple of runs, typically 1–2 months, based on the CMDB Health schedule.
They aren’t designed to be historical trend stores.
2. How to get historical CMDB Health trends (6–12 months):
Option A – Scheduled snapshots (Recommended)
* Create a Scheduled Job / Scheduled Script or Flow to:
* Periodically (e.g., monthly) copy CMDB health scores into a custom table
* E.g., copy from cmdb_health_scorecard_group into your custom historical table, with fields like:
* Month / date
* CMDB group
* Completeness / Correctness / Compliance scores
* This preserves the trend data month over month
* Then you can build your time series reports and Performance Analytics dashboards from this custom table
Option B – Performance Analytics Snapshots
If you have Performance Analytics (PA):
* Create Indicators for Completeness, Correctness, and Compliance scores
* Schedule daily or monthly snapshots
* PA automatically keeps history over time, which you can use for trend charts
Option C – Retain health run results longer (not always best)
* You could technically extend retention by:
* Not deleting past records
* But this may increase table size and isn’t scalable
* ServiceNow doesn’t recommend using the live health result tables for long-term storage
3. Which other tables you might look at:
* cmdb_health_scorecard: Overall CMDB health scores
* cmdb_health_result: Results at individual CI level
Again, these usually only keep recent data.
4. Custom solution (common best practice):
* Build a scheduled script that:
* Runs monthly (e.g., on 1st of month)
* Queries the latest scores per CMDB group
* Inserts them into your custom table: u_cmdb_health_history (example name)
* Use this table as your data source for historical charts
5. Example approach:
/ scheduled script
var gr = new GlideRecord('cmdb_health_scorecard_group');
gr.query();
while (gr.next()) {
var history = new GlideRecord('u_cmdb_health_history');
history.initialize();
history.u_group = gr.group;
history.u_date = gs.nowDateTime();
history.u_completeness = gr.completeness;
history.u_correctness = gr.correctness;
history.u_compliance = gr.compliance;
history.insert();
}
6. Benefits of custom historical table:
* Keeps performance good on the main CMDB tables
* Easy to report on monthly or quarterly trends
* Flexible: add fields as needed (e.g., # of CIs, data source, comments)
7. Suggested next steps:
* Confirm retention policy of CMDB Health in your instance
* Build a custom historical table (u_cmdb_health_history)
* Set up a monthly scheduled job to populate it
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thank You
AJ - TechTrek with AJ
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
ServiceNow Community MVP 2025
* Build reports and dashboards on top
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2025 07:34 AM
Hi @jessicahuan ,
Great question!
This is a very common challenge when building long-term trend reports for CMDB Health in ServiceNow, because by default the CMDB Health data tables are optimized for recent data and don’t store deep history.
Here’s a detailed solution as per my understanding and some practical recommendations:
1. Why your tables only have limited data:
The tables you’re using —
* cmdb_health_scorecard_group
* cmdb_health_result_group_map
— store results only from the last couple of runs, typically 1–2 months, based on the CMDB Health schedule.
They aren’t designed to be historical trend stores.
2. How to get historical CMDB Health trends (6–12 months):
Option A – Scheduled snapshots (Recommended)
* Create a Scheduled Job / Scheduled Script or Flow to:
* Periodically (e.g., monthly) copy CMDB health scores into a custom table
* E.g., copy from cmdb_health_scorecard_group into your custom historical table, with fields like:
* Month / date
* CMDB group
* Completeness / Correctness / Compliance scores
* This preserves the trend data month over month
* Then you can build your time series reports and Performance Analytics dashboards from this custom table
Option B – Performance Analytics Snapshots
If you have Performance Analytics (PA):
* Create Indicators for Completeness, Correctness, and Compliance scores
* Schedule daily or monthly snapshots
* PA automatically keeps history over time, which you can use for trend charts
Option C – Retain health run results longer (not always best)
* You could technically extend retention by:
* Not deleting past records
* But this may increase table size and isn’t scalable
* ServiceNow doesn’t recommend using the live health result tables for long-term storage
3. Which other tables you might look at:
* cmdb_health_scorecard: Overall CMDB health scores
* cmdb_health_result: Results at individual CI level
Again, these usually only keep recent data.
4. Custom solution (common best practice):
* Build a scheduled script that:
* Runs monthly (e.g., on 1st of month)
* Queries the latest scores per CMDB group
* Inserts them into your custom table: u_cmdb_health_history (example name)
* Use this table as your data source for historical charts
5. Example approach:
/ scheduled script
var gr = new GlideRecord('cmdb_health_scorecard_group');
gr.query();
while (gr.next()) {
var history = new GlideRecord('u_cmdb_health_history');
history.initialize();
history.u_group = gr.group;
history.u_date = gs.nowDateTime();
history.u_completeness = gr.completeness;
history.u_correctness = gr.correctness;
history.u_compliance = gr.compliance;
history.insert();
}
6. Benefits of custom historical table:
* Keeps performance good on the main CMDB tables
* Easy to report on monthly or quarterly trends
* Flexible: add fields as needed (e.g., # of CIs, data source, comments)
7. Suggested next steps:
* Confirm retention policy of CMDB Health in your instance
* Build a custom historical table (u_cmdb_health_history)
* Set up a monthly scheduled job to populate it
Please appreciate the efforts of community contributors by marking appropriate response as Mark my Answer Helpful or Accept Solution this may help other community users to follow correct solution in future.
Thank You
AJ - TechTrek with AJ
LinkedIn:- https://www.linkedin.com/in/ajay-kumar-66a91385/
YouTube:- https://www.youtube.com/@learnitomwithaj
ServiceNow Community MVP 2025
* Build reports and dashboards on top