VMware Cloud Community
jayantahirrao
Contributor
Contributor

Handling dynamic auto-population of values on vRO presentation depending upon count

Scenario:

I have a workflow for provision a VM. In this workflow, we have a provision of creating the VM using OVA.

Here if the OVA have 1 NIC count then we have to auto-populate value for 1 NIC, if OVA have 2 NICs then 2 Nic's details will get auto populate and behavior will be same for other NIC count.

So here creation of static screen will not work as we dont know the NIC count (as we are getting NIC count at run-time).

Approach that we have tried:

  • In this approach, the screen will have drop-down field, which will be having the value like Nic-1,Nic-2.....Nic-n (value will be based on the Nic count).
  • If the user will select Nic-1 , then all the fields related to that Nic will get auto-populated according to it.
  • Problem that we faced in this approach:
    • we will showing the value's in the fields(gatewy,DNS,Nic Type,Network,etc) according to the Nic (Nic-1 or Nic-2 etc) value selected from the drop-down.
    • But the problem here is, as we will be using the same field(defined variable) for displaying the values according to the Nic selected, so only the last submitted value will get available at the time of work-flow execution(as we are using the same field for auto-population).
    • For eg: If we have three Nics: Nic-1,Nic-2 and Nic-3.
      • First the user selected Nic-1 from drop-down and did some changes.
      • after that he selected Nic-3 from drop-down and did some changes and click on Submit,
      • So here we will be only getting the modified value for Nic-3 as it is edited last and after that user clicked on submit(as we will be using same fields for all the Nic on presentation).

Is there any way that will handle this scenario?

Tags (1)
Reply
0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

If there is a known upper limit N for the number of NICs (eg. up to 8 NICs), one option to consider is creating N input fields for every NIC property, and then dynamically showing/hiding some of them to match the actual number of NICs.

For example, if you want to support up to 4 NICS, you can create inputs like nic1Gateway, nic2Gateway, nic3Gateway, nic4Gateway, nic1DNS, nic2DNS, etc. And then at runtime if you determine you want 3 NICs, you can hide nic4Gateway, nic4DNS, etc. fields that are related to the unnecessary NICs.

Reply
0 Kudos