- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:46 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 07:06 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:52 AM - edited 07-01-2025 06:53 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 06:54 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 07:06 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 02:32 AM
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;
};