How to extend ServiceNow user criteria and make your life easier

Peter Bodelier
Giga Sage

Have you ever been frustrated by the limited logic available in ServiceNow user criteria? You're not alone. Many developers find themselves scripting custom logic to show or hide catalog items, knowledge articles, widgets, and other elements.

But there's a simpler way: extend user criteria.

That's right, ServiceNow thought of this themselves and made it fully supported.


To extend user criteria, simply add a reference field from the user record to the user criteria table. The field must be of type List, and the names of the fields must match.


For example, to add the user's cost center as a user criterion, you would create a new field in the user criteria table called u_cost_center and set the reference field to Cost Center.


Once you've added the new field, you can use it in user criteria like any other field. For example, you could restrict certain catalog items only to members of a specific cost center.

 

2023-09-20_11h17_42.png

Here's a step-by-step guide:

 

  1. From the User Criteria record click the Hamburger Menu, Configure, Table

2023-09-20_11h19_39.png

 

      2. In the Table Columns related list, click New.

      3. Set the type to List, and then enter the name of the new field.

      4. In the Reference Specification form section, select the reference field from the user record.

2023-09-20_11h39_25.png

 

 

That's it! You've now extended user criteria with a new field.

2023-09-20_11h40_42.png

 

Now, when you're configuring user criteria, you'll see the new field in the list of available fields. You can use it to create more complex and powerful user criteria rules.


So next time you're tempted to script a custom user criteria rule, take a step back and consider extending user criteria instead. It's a simpler and more supported solution.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
1 ACCEPTED SOLUTION

Peter Bodelier
Giga Sage

Not possible to create as article/blog, therefore marking this response as correct to close thread.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

3 REPLIES 3

Peter Bodelier
Giga Sage

Not possible to create as article/blog, therefore marking this response as correct to close thread.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Tuan Vu
Kilo Guru

HI @ Peter Bodelier , Can this be applied for a field type of list in the sys_user table?

Hi @Tuan Vu,

 

No unfortunately this only works with reference fields on the user table.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.