- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:11 PM
Hi All,
i am looking for a User criteria on catalog item that will be available for only Employee type Employee and active True.
how to filter the users with employee type?
usually we add groups and role on the available for but in this case we need Employee type Employee and active user.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:36 PM - edited 02-20-2024 12:53 PM
Hi @Ram050670
You will need to create a New User Criteria (user_criteria) record.
- In the Application navigator, Navigate to the Service Catalog->Catalog Definition->User Criteria
- Check the Advanced check box.
- Write the script as you return the desired filter user.
- Save the Record.
- Go to your catalog item in the Available for related list and Edit the list and enter the user criteria you created.
Script:
This will resolve your requirement.
Regards,
Ashir Waheed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 01:10 PM - edited 02-20-2024 01:10 PM
tried this it worked for me:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:28 PM - edited 02-20-2024 12:29 PM
Hi @Ram050670 ,
You have to write a script in the User Criteria:
checkCondition();
function checkCondition() {
var user = new GlideRecord('sys_user');
user.get(user_id);
if(user.<<custom field name> == 'value of the employee choice') {
return true;
}
return false;
}
If my response helped you, please mark it as correct or helpful.
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 01:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:33 PM
You'll need to call this function in your user criteria record:
new sn_hr_core.hr_Criteria().evaluateById("sys_id_of_HR_criteria_record", user_id);
Then, create a record in the HR Criteria table. (You'll pass the sys_id of this HR Criteria record into the above function.) Within that HR Criteria record, create a HR Condition on the table HR Profile. Make sure your User column is set to User.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:36 PM - edited 02-20-2024 12:53 PM
Hi @Ram050670
You will need to create a New User Criteria (user_criteria) record.
- In the Application navigator, Navigate to the Service Catalog->Catalog Definition->User Criteria
- Check the Advanced check box.
- Write the script as you return the desired filter user.
- Save the Record.
- Go to your catalog item in the Available for related list and Edit the list and enter the user criteria you created.
Script:
This will resolve your requirement.
Regards,
Ashir Waheed