How can I make catalogue item visible to certain user?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 01:06 PM
I want 1 HR user to see the catalog item in Service Portal, how can i make that possible using script in User Criteria.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 01:12 PM
If this is for the standard portal then just setup a user criteria for it.
https://www.servicenow.com/community/now-platform-blog/a-deep-dive-to-user-criteria/ba-p/2281285
But if its for the HR app you may want to look at the HR User Criteria.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2024 02:09 PM - edited ‎06-05-2024 02:12 PM
Hi @Community Alums Refer this community threads
https://www.servicenow.com/community/itsm-blog/scripts-in-user-criteria/ba-p/2294597
You can write a script like below
var user = new GlideRecord("sys_user");
//Change filter according to yours variable names
user.addEncodedQuery("employee_typeSTARTSWITHEmployee^active=true");
user.query();
while(user.next()){
answer=true;
}