Have a collection (vmList) which stores virtual machines and their relevand key:value pairs, like Name, CPU, RAM, etc. One of which is a collection (VM_DisksList) where I want to store an ID and size of each disk for each VM. The VM_DisksList collection should be crated dynamically base on a dropdown (HwCfg_DD_VmPlusDisks) list, where the user specify how my disk should have each VM. And on the next step (next screen) users could specify the size of the disks.
My last try is the following. The code is on the "On Change" field of the mentioned dropdown (HwCfg_DD_VmPlusDisks) element:
Clear(vmDisks);
ForAll(
Sequence(HwCfg_DD_VmPlusDisks.Selected.Value + 1),
Collect(
vmDisks,
{
Disk_ID: Value,
Disk_Size: If(
Value = 1, //Refers to the 1st element of the VM_DisksList, which is allways the OS disk.
Value(HwCfg_TxtI_VmOsDiskSize.Text), //If it's the OS disk, the size is coming from the specified textInput.
10 //else give it a default value: 10 (GB).
)
}
)
);
Patch(vmList, LookUp(vmList, Row_ID = ThisItem.Row_ID), {VM_DisksList: vmDisks})
With the above code, I got warning about "VM_DisksList" does not match the expected type 'record'. found type 'table'
Hi @Btoth ,
I was trawling through some older posts and found this - have you managed to solve it yet?
If not - you said VM_DisksList is a collection - but by the code it appears that it's a column in a collection that contains a collection (vmDisks), is that correct?
Kind regards,
RT
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
49 |