In my lookup table I have options A, B, C, D, Other (in that order) but as multiple choice answers they appear Other, A, B, D, C. I assume that it is ordering the choices alphabetically based on the UID assigned to each field.
Is there a way around this?
Best Answer
The
sort()
function will help you order the options in this case. This function can sort a space-separated list of strings.For instance: Syntax:
sort("a b c d", true())
Examples:Another option is the
sort-by()
function which can be used to sort 1 list based on another.Full documentation on how to use these functions can be found here:
Please note that this function is only available for CommCare mobile version 2.38 or later.