VMware Cloud Community
manfriday
Enthusiast
Enthusiast
Jump to solution

Bug? No duplicate values in an array in vCO 8.10

Hi! I have a workflow i created a long time ago that aids in deploying new VMs from templates.

It will allow me to add additional disks to the VM at deployment time, set them to thin provisioned, add whatever nics I need, generate macs... all the boring stuff I dont want to do manually every time.

However, since upgrading to 8.10 I get an error message when I add duplicate values into the array I use to build the disk sizes.

Say someone asks for a VM with 3 50 GB disks and 2 150 GB disks.

When I try to add that second '50' to the array I get a message "Data provided is already entered."

There are obviously situations where folks are going to want more than one entry of the same value in an array, so this must be a bug, right?

Reply
0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

I think this is not a vRO issue but a custom form limitation. For me it seems the data grid first column is a "key" that has to be unique.

I suggest to use an array instead, as an input:

xian__0-1673539222279.png

That would result in a form:

xian__1-1673539281799.png

 

 

View solution in original post

5 Replies
eoinbyrne
Expert
Expert
Jump to solution

Hi, 

I was curious about this so wrote a quick workflow to look into it on the 8.10 instance I'm using

The workflow has a String/Array attribute like this

eoinbyrne_0-1673536847412.png

No problem adding duplicates that I could see

The workflow script task looks like this (basically adds *another* duplicate value to the Array and prints the result) - Again no problem there. The second part is just a JS object where I tried to set duplicate keys but it behaved as expected

eoinbyrne_1-1673536902210.png

Output when I run it is here

eoinbyrne_2-1673537011338.png

 

Can you give a little more detail on what the context of your usage is & maybe share the problem code?

Reply
0 Kudos
manfriday
Enthusiast
Enthusiast
Jump to solution

Sure. I probably didnt do a great job of describing my issue, and im starting to wonder if it is even related to orchestrator.

I have an input form (a datagrid) where I take an array of numbers:

But imanfriday_0-1673538192052.png

This is where I am getting the error message. I dont think it is even running any of my javascript code yet, save for the action I created which loads the default value by getting the current size of the disk for the template you are running the workflow on:

manfriday_1-1673538358584.png

 

And now if I try to add another 90 to this array, the form throws this error:

manfriday_2-1673538455505.png

So I havent even submitted the form to run any of the javascript at this point.

And now to make matters even weirder.. I shut down my orchestrator appliance, and restored the previous 8.6 version that had been working before.. 

and I am still getting this error. I had to troll through past workflow runs to prove to myself that I am not crazy and that this used to work.

manfriday_3-1673538615565.png

 

Here you can see I had an array with 10 numbers and numerous duplicates. 

This run was done with 8.6. 8.10 is where I first saw the issue, but now I am seewing it with 8.6! crazy.

I did update vcenter to build 20990077, but I am running this workflow from the vRO client at this point, so that shouldnt affect this, right?

im baffled.

 

Reply
0 Kudos
xian_
Expert
Expert
Jump to solution

I think this is not a vRO issue but a custom form limitation. For me it seems the data grid first column is a "key" that has to be unique.

I suggest to use an array instead, as an input:

xian__0-1673539222279.png

That would result in a form:

xian__1-1673539281799.png

 

 

manfriday
Enthusiast
Enthusiast
Jump to solution

I built this workflow so long ago that I don't know why I used the datagrid, or why it used to work and suddenly stopped.

But your solution looks way better. 🙂

 

Thanks! I'll give it a go.

Reply
0 Kudos
manfriday
Enthusiast
Enthusiast
Jump to solution

Ahhh.. I see why I used a datagrid now.

With a datagrid I was able to call an action to get the size of the templates disk and fill it in as a default value.

Then, if the user running the workflow changed the value to something larger the workflow would increase the disk size (if they changed to something smaller it just ignored it and left that disk size alone), and additional entries added to the datagrid would be added as additional disks.

 

It looks like I cant do that if I use the array?

Edit: no, I was wrong. you can totally do that. 

 

Reply
0 Kudos