-
1. Re: About Dynamic Drop-Down List "Name" and "Value"
daphnissov May 29, 2018 8:06 AM (in response to legioon)To do this, you'll need to change your action to return the type Properties. You can then do something like this sample:
if (continent == "NA"){ var props = new Properties(); props.put("US","United States"); props.put("Canada","Canada"); props.put("Mexico","Mexico"); return props;}
continent is my input value. I'm creating a list of properties here. The first entry is the value, the second entry is the display. At the end, return the variable in which your properties are stored. The visible result is like this:
Note that, by default, they will be sorted in ascending order alphabetically.
Second question, you can't hide a drop-down altogether unless you're using custom forms in vRA 7.4. Once you expose a drop-down, it's always there, but you can either force the value of leave it null depending on if you've set it as required or not.
-
2. Re: About Dynamic Drop-Down List "Name" and "Value"
legioon May 31, 2018 5:20 AM (in response to daphnissov)Hi daphnissov, It works. Thank you very much!
-
3. Re: About Dynamic Drop-Down List "Name" and "Value"
michalpawlak Jun 15, 2018 1:28 AM (in response to daphnissov)Nice work, the only problem is that I receiveUnexpected result from action execution. Expected [class com.vmware.vcac.platform.content.literals.MultipleLiteral], got [class com.vmware.vcac.platform.content.literals.ComplexLiteral].once list is longer e.g. 500+ results, does any of you have a solution for that problem?
-
4. Re: About Dynamic Drop-Down List "Name" and "Value"
_mduchaine_ Jul 15, 2019 8:13 AM (in response to daphnissov)I would like to use this on a XAAS blueprint (vra 7.3).
The dropdown should be associated with an input parameter of my workflow. The value returned should be a number, the displayed text a string. Since the output type of the action is array/properties, I'm not able to associate the action with the original type of the attribute, number. I defined the attribute as type "properties" but couldn't associate the action either. What type should I give to my attribute in order to be able to associate with the action?
Thanks
-
5. Re: About Dynamic Drop-Down List "Name" and "Value"
daphnissov Jul 15, 2019 8:42 AM (in response to _mduchaine_)If you're not working with properties, then you work with array/string. The return type needs to also be adjusted as necessary.
-
6. Re: About Dynamic Drop-Down List "Name" and "Value"
xian_ Jul 15, 2019 11:01 PM (in response to _mduchaine_)I managed to do this with Dynamic types, but you need some extra coding on vRO side. Dynamic types are selectable in XaaS forms unlike Properies.