Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Analysis of the content of a CMDB table

ChristopheB7516
Tera Contributor

Hello,

I am looking for a report or a tool wich could produce the following report for any given table :

Quantity of records in the table

For each field in the table :
- Quantity of distinct values

- If the field has less than 11 distinct values, list of the values found for this field

 

Best regards
Christophe BERNARD

2 REPLIES 2

dimitrios_l
Tera Expert

You can do it with a background script or in xplore. 

1-Total record count you can get easy with getRowCount().

2-Get all the fields of the table from dictionary. Loop through them and for each iteration use GlideAggregate and group the records by the field. 

Hi Dimitrios,
thanks for your answer.

Do you know of any ready to run solution for this question?
I have been developing this kind of tool several times with various technologies but I am new to ServiceNow