Lookup Select Box - Reference Qualifier

StefanSrba
Tera Contributor

Hi, 

 

I am having dificulty understanding how to user Reference Qualifier on Lookup Select Box.

Things that I have searched for always asks to set Reference Qualifier to 'advanced' even thou that is option only for Reference type of field.

 

And now that I have an Reference Qualifier that has to be 'advance' I would like to know how to write the RQ itself.

This was created based on other question that people helped me with
javascript:
'u_detailed_descriptionLIKE'+current.variables.application_description+
'^u_operating_system='+current.variables.u_operating_system+
'^NQu_operating_system='+current.variables.u_operating_system+
'^u_category='+current.variables.category+
'^u_sub_category='+current.variables.subcategory;

But I would like to have better control on this, to trigger one part of RQ 

'u_detailed_descriptionLIKE'+current.variables.application_description+
'^u_operating_system='+current.variables.u_operating_system

only if application_description has some text in it and if not to go the other route.

 

Is this even possible with RQ or is this something that should be done with Catalog Client Script?

1 ACCEPTED SOLUTION

@StefanSrba 

yes you can write normal javascript server side code.

ensure the query is set before you use query; as the last line in your script

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@StefanSrba 

then you can use this logic

Ensure you give correct value to compare and correct encoded query

javascript: var query; if(current.variables.application_description == 'your Text1') query = 'your encoded query1'; else if(current.variables.application_description == 'your Text2') query = 'your encoded query2';
query;

Also ensure you give this in variable attributes as your lookup select box is dependent on other variable

ref_qual_elements=application_description

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Can you give me some pointers on what kind of scripting is used here?
What are the rules of writing Reference Qualifier?
Can I, after the javascript: part, write a standard JavaScript code?

@StefanSrba 

yes you can write normal javascript server side code.

ensure the query is set before you use query; as the last line in your script

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Is this okay refenrece query for Lookup Select Box?
javascript:
if(!current.variables.application_description){
'u_operating_system='+current.variables.u_operating_system+
'^u_category='+current.variables.category+
'^u_sub_category='+current.variables.subcategory;
}
else{
'u_detailed_descriptionLIKE'+current.variables.application_description+
'^u_operating_system='+current.variables.u_operating_system;
};