VMware Cloud Community
chrisxhartmann
Contributor
Contributor
Jump to solution

Dynamic fields in presentation view

Hi,

I am currently developing a workflow to build a VM from a template. One of the selections that I want to present to users is the choice to add additional hard disks. Based on the number of additional hard disks that are chosen I then need to be able to give the user the choice of datastore and size for each one. I only want the datastore/size choice to show up for the number of additional disks that are selected, but I can't figure out how to do it. I think I need something similar to the show parameter input property, but need something that is numerically based as opposed to Boolean.

I should also add I am very new to vRO and JavaScript so try and be patient with me!

Thanks,
Chris.

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Chris,

One possible option, if you have an upper limit on the number of additional disks (let's say no more than 15 disks) is to create a presentation with input fields for datastores/sizes for the maximum allowed number of disks, and then for the each datastore/size input field add to it a presentation property 'Hide parameter input' with a value that will compute to true if the field should be hidden.

For example, if the input field for the number of disks is named numOfDisks and has type number, then the first datastore input should have 'Hide parameter input' property with value #numOfDisks < 1, the second datastore input - #numOfDisks < 2, etc. As an effect, when you launch the workflow and enter some number in the number of disks field, you should see the matching number of datastore fields becoming visible.

Another option is to implement some sort of loop in the workflow, which on each loop interaction will show a chooser for a single datastore/size.

View solution in original post

0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Chris,

One possible option, if you have an upper limit on the number of additional disks (let's say no more than 15 disks) is to create a presentation with input fields for datastores/sizes for the maximum allowed number of disks, and then for the each datastore/size input field add to it a presentation property 'Hide parameter input' with a value that will compute to true if the field should be hidden.

For example, if the input field for the number of disks is named numOfDisks and has type number, then the first datastore input should have 'Hide parameter input' property with value #numOfDisks < 1, the second datastore input - #numOfDisks < 2, etc. As an effect, when you launch the workflow and enter some number in the number of disks field, you should see the matching number of datastore fields becoming visible.

Another option is to implement some sort of loop in the workflow, which on each loop interaction will show a chooser for a single datastore/size.

0 Kudos
chrisxhartmann
Contributor
Contributor
Jump to solution

Hi Ilian,

The first suggestion is perfect for my needs.

Many thanks,

Chris.

0 Kudos