Sort Choices by Sequence
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2021 11:25 AM
Hi everyone,
I have a column in one of my tables that stores a Choice value. If I add a sequence number in "Choice Lists" table does that mean choices will be displayed in that order automatically or do I need to add something else to my Encoded Query or Script?
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2021 12:39 PM
Hi,
You can set the sequence there, to set the order, but, it will not automatically do that when referenced (for example when using a "lookup select-box variable in catalog item". So you could that, check and see if it's sorted without any additional need, if not, then add ORDERBYsequence as part of the encoded query and it'll work that way.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2021 11:40 AM
Roberto,
Did you ever find an answer to your question? I am having the same issue and I am not sure how to implement the solution suggested by Allen.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2021 12:12 PM
Hi,
Within the sys_choice table, there is a "Sequence" field. If this is specified, then the order in which those selections would appear, would be per the sequence field. If it's not specified, then by default, it'll use the Label.
However, if you're using a lookup select-box for example...and trying to get the values to show up in sequence order, you'd need to add this statement to your reference qualifier:
ORDERBY=sequence
More discussion here: https://community.servicenow.com/community?id=community_question&sys_id=f260cb34db3ad0104aa5d9d96896...
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!