Sort Choices by Sequence

Roberto Cortina
Tera Contributor

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

7 REPLIES 7

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!

bvlo
Tera Expert

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

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!