- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi Guys
I have tried a few things but I seem to be getting nowhere.
I simply want to filter this LookUp SelectBox (Subcategory) dependant value in the sys_choice table by the Single Line Text field (Category Label)
Bit of context: I was having a nightmare trying to filter directly via the other LookUp SelectBox (Category) but when I did A script include and hard coded the Category as 'End User Hardware' the filter worked!
So now I'm trying to just simply filter by a string.
I am currently just seeing if the following reference qualifier will work:
javascript:
var label = current.variables.category_label;
'inactive=false^element=subcategory^sys_domain=global^name=incident^dependent_value=' + label + '^ORDERBYlabel';
Any help welcome
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
it should work provided you have dependent subcategory for those categories and you added variable attribute as this in lookup select box variable
ref_qual_elements=category_label
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi,
Can you troubleshoot below steps?
1) Make sure category_label is the correct variable name and available in current.variables.
2) Confirm the label exactly matches the dependent values in the sys_choice table (“End User Hardware” or whatever string you use). I hope its works because you said its working when you hardcoded.
and your approach is perfect—just confirm the variable names and values match the sys_choice table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
yea the label is defo the correct one Ive tried label and value and tbf they are both set to the same string value anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Ok hmmmm. few more debugging points from my end.
1) Ensure that category_label is accessible in the scope where your reference qualifier is running.
2)
As you did before, set the dependent_value in your filter to the exact string (e.g., 'dependent_value=End User Hardware') to confirm the filter itself works.
3) Can you see what is gs.info(label) from logs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Hi,
Can you troubleshoot below steps?
1) Make sure category_label is the correct variable name and available in current.variables.
2) Confirm the label exactly matches the dependent values in the sys_choice table (“End User Hardware” or whatever string you use). I hope its works because you said its working when you hardcoded.
and your approach is perfect—just confirm the variable names and values match the sys_choice table.
