Reference Qualifier - a condition combined with ORDERBY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2019 05:57 PM
Hi Community,
I have a question about how to write reference qualifier.
I have a condition to filter a select lookup box, and I want to organize the choices using ORDERBY.
Now my reference qualifier is like this:
javascript: 'u_item_name='+current.variables.u_item_name_women;
And I want to add ORDERBY, however, it didn't work after trying the below ones:
javascript: 'u_item_name='+current.variables.u_item_name_women^'ref_ac_order_by='u_order;
javascript: 'u_item_name='+current.variables.u_item_name_women+'^ref_ac_order_by=u_order';
javascript: 'u_item_name='+current.variables.u_item_name_women^ORDERBYu_order;
I suspect the codes are slightly wrong, but not knowing which part.
I'd be very thankful if anyone could help me.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2019 10:13 PM
Hi
Try ordering by on variable attribute and call the reference qualifier like this
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_field1,ref_ac_columns_search=true,ref_ac_order_by=u_order
http://wiki.servicenow.com/index.php?title=Auto-Complete_for_Reference_Fields#gsc.tab=0
your reference qualifier :-
javascript:'u_item_name='+current.variables.u_item_name_women
Regards,
Omkar Mone.
www.dxsherpa.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2019 10:55 PM
Thank you Omkar,
do I need to change "u_field1" in
"ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_field1,ref_ac_columns_search=true,ref_ac_order_by=u_order" ?
I tried just as you suggested, but still not working...
Cheers,
Lit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2019 11:10 PM
Hi
Don't write anything in u_field1. Try this
ref_auto_completer=AJAXTableCompleter,ref_ac_columns_search=true,ref_ac_order_by=u_order"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2020 06:23 AM
use Variable attribute: ref_ac_order_by=u_order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 11:00 PM
use this
javascript:'u_item_name='+current.variables.u_item_name_women+'^ORDERBYu_order';