Use script includes to suppress filters and breadcrumbs
Use a script include to restrict filters and breadcrumbs to specific roles, either on a per-table or global basis. Using a script is an advanced option that offers additional flexibility compared to using list control.
Before you begin
Using a script include requires knowledge of JavaScript.
Role required: script_include_admin
About this task
The examples shown must be modified for your environment.
Procedure
-
Create a script include with the name
[tablename]DisplayFilter.The script section contains one function with the same name as the script include.
-
Use your function to set the global variable answer to either true (show the filters and breadcrumbs) or false (hide them).
The following example restricts filters and breadcrumbs on the Incident table to users with any role. Be sure that the name of the script matches the function name exactly, including case.
JavaScriptfunction incidentDisplayFilter() { if (gs.getUser().hasRoles()) { answer = "true"; } else { answer = "false"; } return answer;} -
To exclude a specific role from having access to filters and breadcrumbs, make the following change.
JavaScriptfunction incidentDisplayFilter() { if (gs.getUser().hasRoles() && !gs.getUser().hasRoles('newrole')) { answer = "true"; } else { answer = "false"; } return answer;}Users with the newrole role do not have access to filters and breadcrumbs.
-
To let all users use filters and breadcrumbs on the Incident table, make the following change to your script.
JavaScriptfunction incidentDisplayFilter() { var answer = true; return answer;} -
To modify filter and breadcrumb access for another table, create a script include using the name of that table instead of Incident.
---
title: Use script includes to suppress filters and breadcrumbs
description: Use a script include to restrict filters and breadcrumbs to specific roles, either on a per-table or global basis. Using a script is an advanced option that offers additional flexibility compared to using list control.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/platform-administration/list-administration/t\_SuppressFiltersScriptInclude.html
release: brazil
product: List Administration
classification: list-administration
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Restrict filters and breadcrumbs, Administer, List administration, Forms, fields, and lists, Configure core features, ServiceNow AI Platform]
---
# Use script includes to suppress filters and breadcrumbs
Use a script include to restrict filters and breadcrumbs to specific roles, either on a per-table or global basis. Using a script is an advanced option that offers additional flexibility compared to using list control.
## Before you begin
Using a script include requires knowledge of JavaScript.
Role required: script\_include\_admin
## About this task
The examples shown must be modified for your environment.
## Procedure
1. Create a script include with the name `[tablename]DisplayFilter`.
The script section contains one function with the same name as the script include.
2. Use your function to set the global variable *answer* to either true \(show the filters and breadcrumbs\) or false \(hide them\).
The following example restricts filters and breadcrumbs on the Incident table to users with any role. Be sure that the name of the script matches the function name exactly, including case.
```
function incidentDisplayFilter() {
if (gs.getUser().hasRoles()) {
answer = "true";
} else {
answer = "false";
}
return answer;
}
```
3. To exclude a specific role from having access to filters and breadcrumbs, make the following change.
```
function incidentDisplayFilter() {
if (gs.getUser().hasRoles() && !gs.getUser().hasRoles('newrole')) {
answer = "true";
} else {
answer = "false";
}
return answer;
}
```
Users with the newrole role do not have access to filters and breadcrumbs.
4. To let all users use filters and breadcrumbs on the Incident table, make the following change to your script.
```
function incidentDisplayFilter() {
var answer = true;
return answer;
}
```
5. To modify filter and breadcrumb access for another table, create a script include using the name of that table instead of Incident.
| title | Use script includes to suppress filters and breadcrumbs |
| description | Use a script include to restrict filters and breadcrumbs to specific roles, either on a per-table or global basis. Using a script is an advanced option that offers additional flexibility compared to using list control. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/platform-administration/list-administration/t\_SuppressFiltersScriptInclude.html |
| release | brazil |
| product | List Administration |
| classification | list-administration |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Restrict filters and breadcrumbsAdministerList administrationFormsfieldsand listsConfigure core featuresServiceNow AI Platform |