- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 01:42 AM
there were two variable called contractor and manager, contractor is of yes or no type. and manger is of reference type. if we select yes in the contractor then only the users whose mail id contains "@xyz.com" need to be shown in the manager field.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 03:47 AM
Hello @Ak8977
You just use Advanced reference qualifier on "Manager" variable like below & no need to write script include and client script :
Note : Use your variable backend name wherever necessary
javascript: var query;
if(current.variables.contractor == 'Yes'){
query = "emailLIKE@xyz.com";
}
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 01:55 AM
what happens to manager variable if we select "no" as contractor type?
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 01:59 AM
if we select no it need to show all the users.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 02:34 AM
You can write a Script Include:
Script:
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-29-2023 03:47 AM
Hello @Ak8977
You just use Advanced reference qualifier on "Manager" variable like below & no need to write script include and client script :
Note : Use your variable backend name wherever necessary
javascript: var query;
if(current.variables.contractor == 'Yes'){
query = "emailLIKE@xyz.com";
}
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates