Thanks for posting this Jessika, my problem is very similar and I was hoping I could get Ismael to chime in on this. I want to have a list of components (~30) sorted alphabetically in a repeat when I open a survey. The work flow is that components are constantly replaced, so "batteries" end up at the end of the list, making it hard for technicians to locate the component they want to update. By your example above I could use:
pulldata("@javascript","sort_components_alpha.js","sort_component_alpha", ${COMPONENT})
function sort_component_alpha(ary){
//Sort the array in alphabetic order
var arysorted = ary.sort();
//return
return arysorted
}
In doing this, I would have to create a new element like "component2" to put this pulldata function in the calculation field. Is there anything forthcoming that would allow an alphabetical sort without having to create a new field? This would save me a lot of work! Thanks for your time.
-Tom