Hide Columns from the Filter list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 06:11 AM
In various message boards and forums I find that folks have been asking this for at least a decade. Most of the solutions provided have not actually answered the request.
We need to be able to hide a column from the List Filter -- and
We need that column still available in the List View -- and
We need that column still available in the user forms -- and
We need that column still available in user reports
Thus
A read ACL to hide/restrict the field will hide/restrict it from all the items
An add-list ACL prevents it from being added to the list view but it still exists in the filter
Two options came to mind while I have been trying to resolve this
- In the dictionary, it would be nice if there was an attribute such as "no_list_filter"
- And/or, it would be nice if there was a slush bucket in list control indicate by view which columns to hide
Has anyone been able to resolve this issue in a manner that does not incur a ton of technical debt?
I have posted this to SN via HI as a question to suggest an enhancement request for ServiceNow to address it, seems like a lot of folks want this.
One workaround that I am looking at is creating a database view that only contains the columns I want to include, this is a little restrictive and I'd rather not kludge it. I would still like users to be able to have list view of columns I don't want filtered, but at least I can limit it somewhat.
Since it's been at least a decade where folks have asked for this, it would be nice if it did not take another decade to get it.
Thanks,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 02:08 AM
To hide columns from the filter list in ServiceNow, you can follow these steps:
1. Navigate to the list where you want to hide columns from the filter list.
2. Right-click on the column header and select "Configure > List Layout".
3. In the slushbucket, move the columns you want to hide from the "Selected" side to the "Available" side.
4. Click on "Save".
Please note that this will also remove the column from the list view. If you want to hide the column only from the filter list but keep it in the list view, you will need to use a UI Script or a UI Policy. Here is a sample UI Script:
javascript
function onLoad() {
var tableName = g_list.getTableName();
if (tableName == 'incident') {
var ga = new GlideAjax('FilterColumnsAjax');
ga.addParam('sysparm_name', 'getColumns');
ga.addParam('sysparm_table_name', tableName);
ga.getXMLAnswer(handleResponse);
}
}
function handleResponse(answer) {
var columns = answer.evalJSON(true);
for (var i = 0; i < columns.length; i++) {
if (columns[i] == 'column_to_hide') {
g_filter.removeChoice('column_to_hide');
}
}
}
Replace 'incident' with your table name and 'column_to_hide' with the column you want to hide. This script will remove the specified column from the filter list when the list is loaded.
nowKB.com
For a good and optimistic result, and solving ServiceNow-related issues please visit this website.https://nowkb.com/home
Kindly mark correct and helpful if applicable

