My ServiceNow Tips
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2025 09:12 PM - edited 05-12-2025 09:33 AM
The ServiceNow tips and tricks article I have created for myself by going through other community articles posted by users e.g. Maik Skoddow. Please utilize it if you find it helpful.
1. KB0713711
The 'Unique' checkbox on the Dictionary Entry record is NOT intended to be used from the UI. It might create an unique index but it DOES NOT create a sys_index_* record in the Customer Update table [sys_update_xml]. When the creation of that Dictionary Entry is captured in an Update Set and that Update Set is promoted to the target instance, the unique index on that column is not created on the target instance. By default, the 'Unique' checkbox is not added on the Dictionary Entry form, hence, this is NOT the recommended usage. Unique Indexes MUST be created via the Table form [sys_db_object] ('Tables' module or 'Tables & Columns' module) so that a sys_index_* record is created in the Customer Update table. Subsequent commit of the Update Set on target instance will create the unique index.
2. How to drop index from a table
We have a UI action to drop a index but if in case we don't get it. we can run this script.
3. How to check out the script that is protected and can not be viewed through UI.
4. How to find out the error that caused the failing of insert/update operation.
if(gs.nil(current.insert())){
var error = current.getLastErrorMessage();
}
5. How to disable the frustrating search results with the Yokohama release.
With the Yokohama family release, ServiceNow has introduced a new property glide.ui.polaris.nav_filter_accuracy_score (see documentation), which is set to "75" by default. Unfortunately, this results in a rather frustrating user experience when entering search strings such as "user" into the application navigator. With a value of '75' this property will make the search useless as the search string will be split up to give more results. To return to the well-known behavior of exact matches you have to set the value to "100".
6. Development | Data Security
Sometimes it is necessary to generate masses of artificial data that make no sense but are necessary for testing. Here the following API method can help, which expects the length of the string to be generated as the only parameter.

7. TimeZone converter
A simple and undocumented timezone converter in server-side scripts:
var strConvertedDateTime =
new GlideScheduleDateTime("2022-03-03 06:30:00").convertTimeZone("CET", "IST");
var gdtConvertedDateTime = new GlideDateTime(strConvertedDateTime);
gs.info(gdtConvertedDateTime);
8. A table or field exist
You want to verify whether a table or field exists with just a one-liner?
Use one of these two methods:
new GlideRecord('incident').isValid();
gs.tableExists("incident");
new GlideRecord('incident').isValidField('number')
9. Remove HTML tags from string
new GlideSPScriptable().stripHTML(yourHtmlStr);
10. Get the execution time of server side script in ServiceNow
10. ACL execution order for extended table.
1. table_name (row level ACL)
2. (field level ACL)
. table_name.field_name
. parent_table.field_name
2. (field level ACL)
. table_name.field_name
. parent_table.field_name
. parent_table.parent_table.field_name (If parent also has a parent table) and so on.
5. table_name.* (wild card ACL)
Summary: If a table has row-level access granted to a role and there are no field-level ACL restrictions on the table itself, but there is a restriction applied via a wildcard ACL, the user with that role will still have access to the field—provided the parent ACL at the field level explicitly grants access.
5. table_name.* (wild card ACL)
Summary: If a table has row-level access granted to a role and there are no field-level ACL restrictions on the table itself, but there is a restriction applied via a wildcard ACL, the user with that role will still have access to the field—provided the parent ACL at the field level explicitly grants access.
0 REPLIES 0