Reference qualifier not working on variable on portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 05:45 AM
Dear ServiceNow community, I hope all is well!
I am currently facing an incredibly annoying issue with a variable on a catalog item
I have a "Lookup select box" variable on a Catalog Item called "City" that is looking up its values from a custom table I have created, this variable needs to present choices based on a selection from another "Lookup select box" variable called "Project" which is also looking up its values from the same custom table.
I have built a reference qualifier to make sure that the "City" variable presents the values that have the selected "Project" against them in my custom table, here is my reference qualifier and data from both the custom table and the variables on the portal:
javascript:"u_project="+current.variables.project_1_12+"^ORDERBYorder";
As you can clearly see, although I have the "ORDERBYorder" clause added in my reference qualifier, it is being completely disregarded, the values are being sorted in a different manner than the order that I want and no matter what i try it is not working
I have tried creating a custom ordering field and using it but it did not work, I have also checked all the types of my fields on my custom table, the "order" field is an Integer and both the "Project" and "City" are of type Translated Text
What is also weird is that when I attempt using the ordering clause solely in my reference qualifier, it sorts the values by order, here is the syntax I used and how it affects in the portal:
javascript:"ORDERBYorder";
Any clue why this is happening and how I can fix it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 06:06 AM
Hi @Tariq Alshara ,
Sorting seems okay to me in the first scenario. You are trying to achieve as in the second scenario but that is coming without any filter conditions with just the order clause?
Regards,
Badal Khojare
Community Rising Star 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 06:09 AM
Hi @Badal Khojare ,
The first scenario is showing me the intended results but is NOT sorting by order but sorting alphabetically, I want it to return the intended results and sort them by order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 06:07 AM
Hello @Tariq Alshara ,
Try adding ^EQ before the order by query, like:
javascript:"u_project="+current.variables.project_1_12+"^EQORDERBYorder";
If my answer has helped with your question, please mark it as helpful and give it a thumbs up!
Regards,
Shubham

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2023 06:11 AM