The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lookup selectbox reference qualifier

surya123
Kilo Guru

Hi All

I have a lookup select box and I want to write a reference qualifier which will populate the data based on data saved to requested For field.

I had earlier set this up as assigned_to =javascript:gs.getUserID();

But this just fetched record for that user. But since we can change the value of Reqested for, hw should I change the ref qual to get it work???

1 ACCEPTED SOLUTION

That is incorrect. The line ref_qual_elements=.... goes in the variable attributes and the javascript one goes in the reference qual section



ref_qual_elements=Requested_For         ---->This goes in the variable attributes


javascript:'assigned_to='+current.variables.Requested_For     ----->This goes in the reference qual section


View solution in original post

17 REPLIES 17

Chuck Tomasi
ServiceNow Employee
ServiceNow Employee

Hi,



It sounds like you are confusing default values with reference qualifiers. A reference qualifier returns a "where clause" to the query. E.g. if you want only active users to show up in your field that reference sys_user, the reference qualifier is 'active=true' It is ALWAYS a query filter.



If you want it to be variable based on another field, then you need to construct that query filter using the other field.



For example: javascript:'location=' + current.requested_for.location



If it gets more advanced then that, I usually use a function my own script include and call it (known as an advanced reference qualifier.)



http://wiki.servicenow.com/index.php?title=Reference_Qualifiers


Hi Chuck,



I had the lookup select box on Asset table, to get the list of assets assigned to that person.


So,i did put req qualifier there as


ref_qual_elements=<Requested_For>


javascript:'assigned_to='+current.Requested_For


Abhinay Erra
Giga Sage

In order to write reference qualifier on lookup select box, you need to add this to the attributes of he variable ref_qual_elements=<variable name based on which you want to filter>. Once you do that you write ref qual, like javascript:......


Abhinay Erra
Giga Sage

Use this


ref_qual_elements=Requested_For


javascript:'assigned_to='+current.variables.Requested_For