how to extract all column names and labels

Casey12
Kilo Expert

Is there a way to extract a mapping of all column names and their labels for all tables in ServiceNow (or, if not for all tables, for some list of tables)?  Within System Properties \ Import Export Properties, we have the following:

csv:

Export column labels = false (default; i.e., export column names)

xlsx:

Export column labels = true (default; i.e., export column labels)

 

So, leveraging these settings, I know that I can create a list report of each table, download the report twice (once as csv and again as xlsx), and simply line up the columns to determine the column name to label mapping.  But, this will be very tedious to do for lots of tables.

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

HI,

Not quite sure I have understood your requirement but you could extract column name, label and the table referenced (where relevant) from the dictionary /nav_to.do?uri=%2Fsys_dictionary_list.do
Regards Tony

View solution in original post

3 REPLIES 3

Tony Chatfield1
Kilo Patron

HI,

Not quite sure I have understood your requirement but you could extract column name, label and the table referenced (where relevant) from the dictionary /nav_to.do?uri=%2Fsys_dictionary_list.do
Regards Tony

Casey12
Kilo Expert

While the Dictionary method is probably the best way to do this, I noticed something odd with a few tables.  We brought in a consulting company who implemented custom tables for us.  When I go into the Dictionary, I don't see all columns for these custom tables.  Does a dictionary entry need to be created for each and every column manually?

Tony Chatfield1
Kilo Patron

I would expect that the custom table was extended from another table, and so the dictionary has entries only for the fields unique to the custom table as the other fields exist at the root\parent table . Regards Tony