Sorting Variable Choices

I have to track this down every 6 months or so. It’s time I document it here so I can forget I did so and then be impressed that I figured it out at one point reference it in the future.

When a variable has choices, such as a List Collector or Lookup Select Box, it’s often useful to sort the options by an order or sequence field instead of the default field value (typically Name or something similar).

Adding “^ORDERBYorder” or “ORDERBYDESCorder” at the end of the Reference Qual field will not do the trick. The secret is to add “ref_ac_order_by=order” to the Variable Attributes box instead.

You’re welcome, future me.

Leave a Reply