Reference Qualifier on Lookup Select Box Variable

Blair5
Tera Guru

I've been looking through the WIKI/community and it seems like there is a bug with reference qualifiers on Lookup Select box variables. Does anyone know if there is a work around besides making the field a reference variable?

I have 3 variables on a form -- each dependent on the last. The first is a lookup select box and I'd like the second to be a lookup select box with a reference qualifier because setting it as a reference variable gives the same information as the third variable. I've tried only showing the columns I want (with attributes), but it still shows too much.

Is there another angle I can take? Building the list with a script? I only want to show unique values. Any ideas/help would be greatly appreciated because I think I've exhausted all the options I can think of. Thanks!

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Seems like we all have been trolled here Look up select supports reference qualifier but it's not simple as reference field..



Check the wiki page



http://wiki.servicenow.com/index.php?title=Variable_Types#Lookup_Select_Box



We need to use 'ref_qual_elements' attribute to get the updated reference working..


I am able to do the dynamic thing working after adding the attribute...



Sample demo:



Create 2 lookup select variable called 'located_at' and 'user' referring location and user table respectively.


Idea here is to display the user depending on the location selected...


In the user variable, define reference qual as javascript: 'location='+current.variables.located_at; and variable attribute as ref_qual_elements=located_at



This will make the variable to use the updated reference. Try this out and let me know if this works for you as well.



Note: I tried on Fuji instance.


View solution in original post

78 REPLIES 78

Inactive_Us1890
Tera Contributor

Hello,

I am almost going crazy trying to find an answer similar to your question-

brienhart, please let us know how you solved for this issue

Catalog Item- ServiceNow Fulfiller Access Request used to Add or Remove users from Groups

 

Variable  - grp_rmv- references 'Groups'

Variable type- Lookup Select Box

Used to display the 'current groups of the 'requested for' - so that users can choose it to have themselves removed from a group.

 

Reference Qualifier- javascript:'sys_idNOT IN'+new CustomGroupUtil().getUserGroups(current.variables.requested_for);

ref_qual_elements=requested_for

 

I try to log the value of current.variables.requested_for in the Script Include- but it logs as undefined!

 

Any help is really appreciated,

 

 

Hi,

The requested_for field is a field of the request on not a variable. Instead of:

current.variables.requested_for 

 

try

current.request.requested_for.

 

Best Regards,

Luis Franco

Thank you!

Kailash Bhange
Kilo Sage
Kilo Sage

Hi All,

 

Please take a look at Article below:

 

[SOLVED]: - Dependent variable on Catalog item using Lookup Select Box

https://community.servicenow.com/community?id=community_article&sys_id=1ce7dceedb5914101cd8a345ca961...