
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 01:56 AM
Good morning,
We have a section on our ServiceNow instance where users can select a training course from a dropdown list, in this case Excel.
Currently the Lookup Select box has a reference qual containing u_type=excel so it filters on Excel only which refers to the IT training table:
The training table's choice list shows the courses and lists them with a sequence value as well as a label (just the Excel ones shown for reference):
However, when a user is using the service portal, the drop down list is sorted by the Value rather than the sequence, so labels appear in that order, instead of in the sequence order which is preferred. I did try to add ^ORDERBYsequence to the end of the reference qualifier but that failed to change anything.
Although the values could be changed to be set alphabetically, would this impact on users who have already filled out the forms and selected a course where they've created a requested item already? Or is there a way to ensure the order by is by sequence, so if more are added in future, we can always set the sequence order accordingly?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2018 02:27 AM
So I was able to resolve my own problem, it was a case of instead referencing the sys_choice table directly, but filtering out based on the dependent value being excel (effectively what the u_type field is set to):
So by ensuring that the value is the course field selected, with the label showing on screen as to which to be selected, it was then a case of narrowing down in the reference qual.
The element u_course is only used for IT training, although I could also add that in to the reference qual if it wasn't.
This then shows the courses in the order of sequence in the drop down list:
And if I change the sequence order, this order also changes, which is the behaviour we'd like.
Just in case anyone else happens to need this, hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 04:02 AM
Hi warren
Just add ORDERBY and the column name to the reference qualifier should work.
E.g.
ORDERBYsequence^u_type=excel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 04:31 AM
Good afternoon Michelle,
I had tried that, and the order didn't change unfortunately. It's almost as if it's defaulting to the value for ordering without it being specified in the reference qualifier. Would rules be the next way to go?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 04:52 AM
Hi Warren,
Good way to do it is via user preference, this was an answer posted by palmen
I would assume you could set a user preference for this that is system wide so everyone should get it unless they change it themselves to something else.
The user preference should be
TABLE_NAME.db.order
The value should be the field name to sort on
You can also create a user preference named
TABLE_NAME.db.order.direction
The value should be ASC or DESC depending on if it should sort ascending or descending
Make sure to mark the System checkbox so it becomes systemvide
Example for Incident table
incident.db.order -> value = number
incident.db.order.direction -> value -> DESC

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2018 06:38 AM
Try adding ^EQ before Sequence,
We do something similar and below works for us.
u_active=true^EQORDERBYu_sort