How to get Lookup Select Box order to match sequence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2018 11:24 AM
I'm working on a scoped application where I created a table that has a field named model that is a type of string and has the several choices set with a sequence for example they are set to C2, C4, P5, P6, I7, I8 in order from 0-5. I have a record producer I have created with a Lookup select box referencing that table with the Lookup Field Value set to the Model field, Include none is checked, Unique values only is checked. The reference qualifier I have tried is ORDERBYsequence^type=360 and also ORDERBYsequence by itself and I get the same results, the order is alphabetical not taking into account the sequence. C2, C4, I7, I8, P5, P6. Clearly I don't have the correct reference qualifier and in searching the community I'm only seeing references to the ORDERBYsequence qualifier. What am I missing?
Thanks.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2018 01:41 AM
Hi Tate,
make sure you go though these articles about ref quals - especially the second one where it says:
"Note: Reference qualifiers do not support the ORDERBY condition. In reference qualifiers, you can sort the reference lookup list by using standard list controls. To specify the order of an auto-complete list for a reference field, use the ref_ac_order_by dictionary attribute."
source: https://docs.servicenow.com/bundle/london-platform-administration/page/use/using-lists/concept/c_Enc...
General article on ref quals: https://docs.servicenow.com/bundle/london-platform-administration/page/script/server-scripting/conce...
Kind regards
Seb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2018 05:33 AM
I just added the ref_ac_order_by=sequence to the dictionary attribute to the field on the table being referenced (see below) but on the record producer I am still not seeing it sort based off of sequence.
I also tried to add ref_ac_order_by=sequence into the Variable attributes field (I think that's maybe that is what the article above should be referencing) but I'm still not getting any change.
Thanks for the info above, I hadn't come across that before.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2018 07:40 AM
I am curious, if your ref qual works on an actual reference field (dictionary). Because currently you are working on a record producer variable, right.?
Could you test that? I ask, because I have seen funny things before 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2018 07:47 AM
Well, that's hard to say. While I added the attribute I am using the Sequence number which is how it would sort regardless.