Retrieve all the Field Names of change_request table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2013 04:43 AM
The table change_request is used to store the details of all the change requests in service now. I would like to know what are the fields in that table.
Is it possible to get that list by using any functions on GlideRecord api or any api ?
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2013 10:59 AM
Take a look at ---
https://wiki.servicenow.com/index.php?title=GlideRecord#getFields
// This can be run in "Scripts - Background" for demonstration purposes
// Get a single incident record
var grINC = new GlideRecord('incident');
grINC.query();
grINC.next();
gs.print('Using ' + grINC.getValue('number'));
gs.print('');
// getFields() returns a Java ArrayList
var fields = grINC.getFields();
// Enumerate GlideElements in the GlideRecord object that have values
gs.print('Enumerating over all fields with values:');
for (var i = 0; i < fields.size(); i++) {
var glideElement = fields.get(i);
if (glideElement.hasValue()) {
gs.print(' ' + glideElement.getName() + '\t' + glideElement);
}
}
gs.print('');
// Get a specific GlideElement: number
gs.print('Getting the number field:');
for (var i = 0; i < fields.size(); i++) {
var glideElement = fields.get(i);
if (glideElement.hasValue() && glideElement.getName() == 'number') {
gs.print(' ' + glideElement.getName() + '\t' + glideElement);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2013 11:33 AM
seems like the easiest way would be to go to system definition/dictionary
filter to the table you want
then export the list to excel if you are looking to provide documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2013 09:36 PM
thanks..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2013 09:36 PM
Thank you .. able to get it..