Product: PowerShell Universal
Version: 4.1.8
I seem to have an issue with displaying the results of a form submission in a a different New-UDElement, but only if the form -OnSubmit contains Invoke-PSUScript.
This is the code:
New-UDCard -Title 'Search' -Style @{margin = "8px 0px 0px 20px" } -Content {
New-UDForm -Id 'searchForm' -ButtonVariant contained -Content {
New-UDTextbox -Label 'Search Mobile Number' -Id 'phoneNumber'
} -OnSubmit {
Invoke-PSUScript -Name MySQL_Connect.ps1 -DatabaseEnv 'PROD' -DatabaseName 'POSH' -Query "SELECT * FROM table where recipient = $($EventData.phoneNumber);" -Wait | Tee-Object -Variable searchResults
Set-UDElement -Id 'resultsOutput' -Content {
New-UDTable -Id 'smsSearchTable' -Data $searchResults -Columns $searchResultColumns
}
}
New-UDElement -Id 'resultsOutput' -Tag 'div'
}
If i comment out the Invoke-PSUScript line then it works but obviously without any data but i can see where the data would have been and the form is still visible
Any idea how i can get it to work?
Regards,
Jamie