I have an action with a property defined as below:
keyValues.put("CentOS7PXE","CentOS 7 PXE");
keyValues.put("CentOS8PXE","CentOS 8 PXE");
keyValues.put("Ubuntu1804PXE","Ubuntu 18.04 PXE");
keyValues.put("Ubuntu2004PXE","Ubuntu 20.04 PXE");
When I set the values to this external action the values get sorted as:
Ubuntu 20.04 PXE, CentOS 7 PXE, CentOS 8 PXE, Ubuntu 18.04 PXE
Any clue why Ubuntu 20.04 PXE is being listed at the top?
Just as mentioned in your other post, I copy it here as well: it is possible to sort as you wish, you need to return an array of Properties and that'll define the order. See my blog post at vRA Custom Form Dropdowns with External Source
As far as I know, you can't. I had the same problem back with vRO 7.x, you cannot sort the keys and values of a Property object.
But, I see that your keys and your values are pretty similar. You can return a string array instead and the order in vRO will be the same in vRA.
Just as mentioned in your other post, I copy it here as well: it is possible to sort as you wish, you need to return an array of Properties and that'll define the order. See my blog post at vRA Custom Form Dropdowns with External Source