- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2020 07:11 PM
Hi All,
We have had some user criteria established for a while on our KB and Catalog items.
We're using the advanced script as follows to check if a user has a Staff ID, meaning only staff should be able to access the item in question:
(function() {
var staffId = gs.getUser().getRecord().getValue('u_staff_id');
return !gs.nil(staffId);
})();
This doesn't want to seem to work. Is there any other way to get this function to work correctly?
Thanks,
Ed
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2020 07:32 PM
Hi Ed,
User Criteria is cached when you use admin user. Make sure you double check:
- Impersonate not admin user
- Clear cache servicenow by https://devxxxx.service-now.com/cached.do
- Clear cache browser or open another browser to impersonate correct answer
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
DXC Consultant.
Cuong Phan
ServiceNow Technical Lead

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2020 07:32 PM
Hi Ed,
User Criteria is cached when you use admin user. Make sure you double check:
- Impersonate not admin user
- Clear cache servicenow by https://devxxxx.service-now.com/cached.do
- Clear cache browser or open another browser to impersonate correct answer
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
DXC Consultant.
Cuong Phan
ServiceNow Technical Lead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2020 07:41 PM
hi
Thanks for this - that seems to have worked. Great help, thank you!