- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 12:12 AM
Hi,
I'm building a service request to allow requester to manual select approver from user table. However I want to restrict requester to select ownself as approver. Any suggestion how can I build it? Thanks.
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 12:20 AM
Hi,
You can add following reference qualifier to your approver variable. Once this is added current user will not be listed in the variable
javascript:"sys_id!=" + gs.getUserID();
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 12:17 AM
Hi Steven,
You can right Business Rule on Approval Table to validate that Approver is not same as Approval for.Requester. In that case it should AboutAction.
Please mark this as correct answer if it resolved, or mark this helpful if this help you to reach towards solution.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 12:17 AM
hello Steven,
you can write an on change client script on the approver field for this thing
Assuming this is a service catalog and requestor is the logged in user i can give your this below script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if(newValue==g_user.userID)
{
alert('You cant select yourself as approver')
g_form.clearValue('your_approver_field_name');
}
}
Hope this helps
PLEASE MARK YM ANSWER CORRECT IF THIS HELPS YOU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 01:23 AM
Thanks @Mohith Devatte, I've used Reference qualifier to eliminate requester name from selection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2022 12:18 AM
whenever user selects the approver you can write an OnChange Client script to check
if (newValue == g_user.userID){
clear that field and display error msg
}