
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2021 12:51 PM
Does anyone know of a way to see if custom fields are being used and if so, where?
Solved! Go to Solution.
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2021 07:14 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 01:32 PM
Ankur,
It's not the solution I was hoping for but I suppose it works. I was hoping I could get a list of unused fields so that I could easily deactivate several at a time.
I appreciate your response. Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 02:58 AM
Hello All,
I found this script in the community. It might help to get the unused fields in the incident table.
All that you need is to replace the table name.
var table = 'incident';
var gr = new GlideRecord(table);
gr.setLimit(1);
gr.query();
gr.next();
var fields = gr.getFields();
for (var i = 0; i < fields.size(); i++) {
var field = fields.get(i).getName();
var empty = isEmpty(table, field);
gs.print('Column: ' + field + ' Empty: ' + empty);
}
function isEmpty(table, column) {
var col = new GlideRecord(table);
col.addNotNullQuery(column);
col.setLimit(1);
col.query();
return !col.hasNext();
}
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2022 05:45 AM
where to write this script? and how to find those unused field? i am new to it