Hey all,
Hoping someone can help. I’m trying to get a dynamic element to populate within a step in a stepper. Is this function supported?
New-UDStep -OnLoad {
New-UDElement -tag 'div' -Content { "Do you want to forward mail to the manager?" }
New-UDRadioGroup -Id 'MailForward' -Content {
New-UDRadio -Label Yes -Value 'Yes'
New-UDRadio -Label No -Value 'No'
} -OnChange {
Sync-UDElement -Id 'ManagerDynamic'
}
New-UDDynamic -Id 'ManagerDynamic' -Content {
if ($EventData.MailForward -eq 'Yes') {
$ADUser = $Body.Context.Username
$ManagerUsername = (Get-ADUser -Identity $ADUser -Properties Manager).Manager
$script:Manager = (Get-ADUser -Identity $ManagerUsername).SamAccountName
New-UDElement -tag 'div' -Content { "Do you want to forward mail to $Manager?" }
New-UDRadioGroup -Id 'Manager' -Content {
New-UDRadio -Label Yes -Value 'Yes'
New-UDRadio -Label No -Value 'No'
} -OnChange {
Sync-UDElement -Id 'MailForwardDynamic'
}
}
}
New-UDDynamic -Id 'MailForwardDynamic' -Content {
if ($EventData.Manager -eq 'No') {
New-UDElement -tag 'div' -Content { "Who do you want to forward email to?" }
New-UDTextbox -Id 'ForwardAddress' -Placeholder "Enter the SamAccountName" -Value $EventData.Context.ForwardAddress
}
}
} -Label "Step 3"
Product: PowerShell Universal
Version: 2.2.0