Article

Granting Catalog Access to Users with Custom Criteria in ServiceNow

Author: Agus Budi Harto, 2025-06-04 09:31:36

In ServiceNow, service catalogs are designed to be accessible based on user needs. It's important to determine whether a catalog should be visible to all users or only to those who meet certain criteria. Making every catalog available to all users, regardless of relevance, not only clutters the interface but can also lead to unintended consequences—such as users submitting tickets out of curiosity, even when they don’t need the service.

Fortunately, ServiceNow allows administrators to define who can access a catalog at the time of its creation by configuring the ‘Available For’ field. This field lets you restrict visibility to users based on predefined criteria. Out of the box, ServiceNow allows you to specify:

  1. Individual users

  2. User groups

  3. Roles

  4. Companies

  5. Locations

  6. Departments


However, sometimes the criteria required for access might be more specific or broader than these built-in options. For instance, what if you want to make a catalog available only to users who belong to any group whose name contains a specific phrase?

To handle such scenarios, you can enable Advanced conditions and write a script to define your own logic. Here’s an example of a script that grants access to users who are members of a group with a name that includes “my group team”:

var userGr = new GlideRecord('sys_user_grmember'); userGr.addQuery('user', user_id); userGr.addEncodedQuery('groupLIKEmy group team'); userGr.query(); if (userGr.next()) { answer = true; } else { answer = false; }

This script checks whether the current user is a member of any group with a name that includes the specified string. If such a group membership exists, the user is granted access to the catalog.



Conclusion
Using custom criteria to control access to catalogs in ServiceNow helps maintain a clean user experience and prevents unnecessary service requests. With advanced scripting capabilities, you can fine-tune catalog visibility based on complex organizational needs.

Happy configuring!

LinkedIn

Tags: Opinion Servicenow

273 reviews


Add comment