VMware Cloud Community
qc4vmware
Virtuoso
Virtuoso
Jump to solution

vRA 8.5 sort of dynamicEnum not as defined in property?

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?

Reply
0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

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

View solution in original post

2 Replies
bdamian
Expert
Expert
Jump to solution

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.

---
Damián Bacalov
vExpert 2017-2023 (7 years)
https://www.linkedin.com/in/damianbacalov/
https://tecnologiaimasd.blogspot.com/
twitter @bdamian
Reply
0 Kudos
xian_
Expert
Expert
Jump to solution

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