How to order a the choices on a variable that uses another table's choice field

Joey Wan Kenobi
Tera Guru

For a catalog variable, you can 'borrow' a choice field from another table, hence using those choices for said variable. The choice list for the original field does have sequence settings, however, the sequence setting seems to be ignored when the choice list is used in conjunction with the variable. From what i can tell, the variable only uses lexicographical order based on the choices "values."

 

Does anyone know how I can go about ordering the (borrowed) choices in the catalog variable?

5 REPLIES 5

ccajohnson
Kilo Sage

In order to better troubleshoot your issue, we need to know how the variable is currently set up. Please provide us with the configuration you used for your variable so we can duplicate your issue and determine the best solution.



Thanks,


If it helps, here is a screen shot of the variable


9-9-2014 1-04-55 PM.png


One way I have gotten around the sorting problem is to use a Lookup Select box and point the Lookup to the Choice table. I am guessing that the subcategory 2 field on the Task table is a custom field called u_subcategory_2. Based upon this, here is the variable settings to try:



Type: Lookup Select Box


Lookup from table: Choice [sys_choice]


Lookup value field: Value


Lookup label field(s): label


Reference qual: element=u_subcategory_2^name=task^inactive=false



This should give you the variable choices in alphabetical order. If you need to have it in sequence order, then you will need to do some scripting and actually build the menu.



Let me know if this is helpful, or if you need to actually build the menu through a script.


There is no need to create additional scripts.


Just add ORDERBY and the column name to the reference qualifier.


E.g. for the choice table:


ORDERBYsequence^element=u_subcategory_2^name=task^inactive=false