- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 12:24 PM
I have a list collecter variable that currently is set to only display members of a selected assignment group. This is great as long as the group is in ServiceNow. Part of the build is for items that won't be an assignment group, but still uses the user lookup.
Can something be setup in the Reference Qualifier to the effect of "javascript:if(current.variables.var1=X no filtering);else(Group_member(current.variables.var2):
If that's not possible, should it be looking to client script, or similar to do the work?
Thanks!
Erik
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 12:29 PM
script includes aren't necessary... Yes is it possible and there are many out of the box fields with them. I have learned best by looking at out of the box examples over the last many years. Navigate to System Definition \ dictionary and search where reference qual contain "if" for many examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2021 09:15 AM
Thanks and noted for the future...I wussed out and went script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2019 01:58 PM
Thanks Elijah and Michael,
I was hoping to avoid using a client script and following Michael's suggestion I was able to.
My original example script was pretty close to what I needed, and having the reference to the dictionary was what I needed.
New Example:
javascript:if(current.variables.var1 == 'x')Group_member(current.variables.var2); else'active=true';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2021 09:41 PM
This worked for us with modification on enclosing the first qualifier in ''. Thanks!
javascript:if(current.variables.var1 == 'x')'<qualifier 1 here>'; else'<qualifier 2 here>';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2021 02:50 AM
Hi All,
I used your defined reference qualifier for my condition at the variable level and it works however it has got some additional condition to place like
Reference qualifier is based on Group table and user don't want to see groups of type request_approval whether it is ADD or REMOVE.
I am trying like this
javascript:if(current.variables.add_remove=="Remove")
"typeNOT LIKE1baabd380ff02a8843881efae1050e44^sys_idIN"+gs.getUser().getUserByID(current.variables.requested_for).getMyGroups().toArray().join();
else
"typeNOT LIKE1baabd380ff02a8843881efae1050e44";
But it didn't work. Do I need to write script include and do the filter or doing any amendment on the existing query will work.
Any help will be much appreciated!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2023 06:09 AM
Hi JC S
javascript:if(current.variables.var1 == 'x')'<qualifier 1 here>'; else'<qualifier 2 here>';
here what is Qualifier 1 and qualifier 2?