Reference qualifier not working on variable on portal

Tariq Alshara
Tera Expert

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";

 

Values from custom table.pngPortal page.png

 

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";

 

Portal page 2.png

 

Any clue why this is happening and how I can fix it?

12 REPLIES 12

Swapna Abburi
Mega Sage
Mega Sage

Hi @Tariq Alshara 

Just curious if you are using custom table for lookup select box variable then order field is a custom field which should start with u_order.

Vishal Birajdar
Giga Sage

Hello Tariq Alshara ,

can you please try Variable attributes field on that lookup variable ?

 

VishalBirajdar7_0-1676213268246.png

 

Hope this will work for you...!!!

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

R_52
Tera Guru

@Tariq Alshara  did you get any solution/workaround ?