The CreatorCon Call for Content is officially open! Get started here.

set reference qualifier through script for Lookup

sncrnd
Kilo Contributor

I am working on Eureka and looking help to set reference qualifier through script for Lookup Select box catalog variable. I have two variables:

  1. Application   - Select box
  2. Operation — Lookup select box

 

I put reference qual = "u_application_unit=" + current.variables.application for variable "Operation".

 

But this works only on load not on change of variable Application   variable. reference current.variables in the reference qualifier and have the field refresh when another variable changes

Can anyone help me how to do this.

 

Thanks

Chandan !

30 REPLIES 30

Niclas
Giga Guru

Hey,



i came across this old article by googling and the previous answers did not help. So I hope this is helpful for other peoples finding this topic:



If you want to onChange refresh the available choices of a Lookup Variables based on one ore more other dependent variables you simply need to add the ref_qual_elements attribute to the Variable attributes   field of your Lookup Variable. (The field is may not be shown on the form by default so you probably need to configure the view). This attribute specifies a semicolon separated list of fields to be sent back to the server in order to get an updated reference.



Example: ref_qual_elements=category;request_for;type



This will refresh the available choices for the Lookup Variable everytime you change the category, request for or type variable on client side. I have observerd that every time the list refreshes the previously selected value will be cleared, so it cannot happen that the user will accidently save an invalid value


The attribute is documented in the following Wiki-Articles:


Thanks a lot niclas. Finaly correct answer. I had similar issue today,


I am putting working example for future reference:


I have two variables(Lookup select box) and on second variable I need ref qualifier:


javascript:'u_active=true^u_location!=' + current.variables.first_variable


This was evaluated just on load. But when I put on second variable attribute as you suggested:


ref_qual_elements=first_variable


Everytime first variable is changed, choices for second one are updated.


I cannot get "reg_qual_elements" working for List Collector. Anyone have any idea ?



I have a user field 'user' (reference) and Group (List Collector). The list collector is using advanced reference qual to get groups belonging to a selected user using script include...The problem i am facing is when i change user then this list does not get refreshed by putting ref_qual_elements = user.


This is not working in service portal. can u please help me to get this worked in service portal?


johnram
ServiceNow Employee
ServiceNow Employee

The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Types of Service Catalog Variables        
Dictionary Attributes      
   


Visit http://docs.servicenow.com for the latest product documentation