Skip to main content

Reporting on Field Usage

Jonathan Jacob

Often times on the ServiceNow platform, you want to look at the use of columns on a table. While you could easily build a report, that presents a challenge because you want to slice across all of the fields on a table rather than looking at a distinct set of values across one field on the table.

I am sure you have your own reasons for this type of report, but here are some potential uses:

  1. Platform Hygiene
  2. Removing fields with little adoption / use
  3. Removing tables with little adoption / use

The reporting engine doesn't really allow for this type of reporting. But surely this must be possible - right?

The platform has a feature that has a slightly different intended use but can be leveraged to assist with this type of reporting.

⚠️
This is an undocumented feature. Use at your own risk, use in a non-production environment.

Enter sys_column_stats_registry [Column Statistics Registry]. This table is where you specify which table, and which field(s) you want to generate a report for.

  1. Specify the table name, if you are working with a table that is extended you will need to input both the parent and child class.
  2. Specify a specific field name or use the wildcard * to scan all fields on the table
  3. Submit the record and return to the list of records
  4. Use the List Related Link: "Collect statistics now" which will invoke a progress worker.
  1. Visit the sys_column_stats table to view the collected results. Depending on your table size, this could take some time for the progress worker to complete.

Results

On the sys_column_stats table the statistics are displayed:

Null count: fields with no value set

Not null count: fields with a value set

Cardinality: a count of distinct values in a table

I find it best to join this data with the dictionary data, this way you have access to the field type and the field label.

This is an excellent tool to have. Give it a try and I'd love to hear your use cases for this!