- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 06:14 AM
We have had several integrations in our test instance of service now. I need a list of all the class names in CMDB_CI table. I could group by class name (which is 237 classes) I just want of list of the 237 class names not the over 3 million CI's that go with it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 06:16 AM
Hi @PennyC
Go to sys_db_object
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 06:34 AM
Thanks! This did get me all the CMDB_CI class names. I only want the CMDB_CI class names that have data in them, meaning CMDB_CI class names in use, some are empty. Is there a way to tell that?
Thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 06:16 AM
Hi @PennyC
Go to sys_db_object
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 06:34 AM
Thanks! This did get me all the CMDB_CI class names. I only want the CMDB_CI class names that have data in them, meaning CMDB_CI class names in use, some are empty. Is there a way to tell that?
Thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 06:53 AM
Hi @PennyC
No mate, that's not possible automatically. What you can do is handle it manually. The way you get the 237 classes now, group them by the same category, copy the class names, and then go to Excel and paste them there.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 07:02 AM
Hello @PennyC
Yes it can be done via script.
var gr = new GlideAggregate('cmdb_ci');
gr.addAggregate('COUNT');
gr.groupBy('sys_class_name');
gr.query();
while (gr.next()) {
var count = gr.getAggregate('COUNT');
if (count > 0) {
gs.info(gr.getValue('sys_class_name') + " -> CI Count: " + count);
}
}
You can various other conditions here, count and all, I pulled out duplicates today on both name and serial number.
Kindly mark my answer as helpful and accept solution if it helped you in anyway,
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY