Hello everyone
I am trying to create a dropdown list, with the source data from another list.
But i am not sure if i am doing it rigth, this code works but i am wondering if there is another way to do this any, tips and tricks is appriciated
i am new to coding in powershell and powershell universal
$ar1 = @()
$ar2 = @(“1”,“2”,“3”)
$i = 0
foreach($a in $ar2){
$ar1 += (New-UDSelectOption -Name $ar2[$i] -Value $ar2[$i])
$i++
}
New-UDSelect -Multiple -Option {
$ar1
} -OnChange {
Show-UDToast -Message (ConvertTo-json -InputObject $EventData)
}
Product: PowerShell Universal
Version: 1.4.6