I am trying filter users by search from AD and get buttons tor form in the table but not working. What am I missing.
New-UDForm -Content {
New-UDTextbox -Placeholder 'Identity' -Id 'txtIdentity'
} -OnSubmit {
$Input = ConvertFrom-Json $Body
$CominedUser = "*$($Input.txtIdentity)*"
New-UDTable -Title 'Active Directory' -LoadData {
$TableData = ConvertFrom-Json $Body
$UserObject = Get-ADUser -Filter {name -like $CominedUser} -Server $Server -Credential $Credential -Properties * -ErrorAction Stop | ForEach-Object{
@{
Name = $_.Name
Username = $_.SamAccountName
}
}
$UserObject | Out-UDTableData -page $TableData.page -TotalCount $UserObject.Count -Property $TableData.Properties
}-Columns @(
New-Udtablecolumn -Property 'Name'
New-udtableColumn -Property 'UserName'
New-udtableColumn -property 'UserName' -Title 'More Info' -Render {
New-UDButton -Id "btn$($EventData.Name)" -Text "Click Now" -OnClick{
}
}