Jakob Anker
ServiceNow Employee
ServiceNow Employee
As true as it is that data, in general, should never leave ServiceNow, if it can be avoided, it can be beneficial to export some data to Excel.
A rule of thumb: it is OK to extract data if the extraction is not degrading the workforce's ability to collaborate as a coherent unit through a single source of truth.

Extracting through Utility action

Extracting through RPA
Extracting through URL appendage
Extracting data through background script
This is only relevant if you need to extract large volumes of data across different tables with the potential for data transformation.
Building a script where you query and manipulate your data is needed. Then use gs.log() to print out the data rows you need. Use | as a column separator, and remember to add a log source (2nd parameter).
 
Script Example
gs.log('Number'+ '|' + 'State' + '|' + 'Brag'
var grIncident = new GlideRecord('incident');
grIncident.addActiveQuery();
grIncident.query();
while(grIncident.next()){
gs.log(grIncident.number + '|' + grIncident.state + '|' + 'Look at me I am using background scripts to create spreadsheet data','spreadSheetRow');
}
 
Expected output
spreadSheetRow: Number|State|'Brag
spreadSheetRow: INC0000001|Open|Look at me I am using background scripts to create spreadsheet data
spreadSheetRow: INC0000002|Resolved|Look at me I am using background scripts to create spreadsheet data
spreadSheetRow: INC0000003|Open|Look at me I am using background scripts to create spreadsheet data
 
Data Cleanup
Use a program like notepade++ to remove any script tags (spreadSheetRow:)
Protip: you can use regular expressions to replace any lines containing any log statement contaminating your log output.
Example: /.*wordOrSentenceFoundInLine.*/g
Save the notepad once cleaned.
 
Moving to Excel
Open excel.
Go to data and add Text source.
Find your file and load the data.