Hello all,
I have a function that runs some queries on a database and returns the data on a grid, so far so good.
However, when I try to run a different query that includes a different set of columns, then somehow the data does not update correctly. The strange thing is If I hit refresh, then data will appear correctly.
Here is a example:
Get-Report -Date “Last Year” -ReportType “Report 1” Should return -> Cat | Number
Cat | Number |
---|---|
N/A | 549 |
Get-Report -Date “Last Year” -ReportType “Report 2” Should return -> Cat2 | Number
Cat | Number |
---|---|
5436 |
Here is a snippet from the dashboard:
New-UDTabContainer -Tabs {
New-UDTab -Text "Period" -Content {
New-UDInput -Title " " -Id "Form" -Content {
New-UDInputField -Type select -Name "Period" -Values @($Period)
New-UDInputField -Type select -Name 'ReportType' -Values @($ReportType)
New-UDInputField -Type select -Name 'Departments' -Values @($Departments)
} -Endpoint {
param($Period, $ReportType, $Departments)
$creds = @{
TypeName = 'System.Management.Automation.PSCredential'
ArgumentList = "user", $Password
}
$params = @{
Server = 'xxx.xxx.xxx.xxx'
Database = 'db'
Period = $Period
ReportType = $ReportType
UserName = 'user'
Credentials = New-Object @creds
}
$Session:Results = Get-Report @params
Sync-UDElement -Id "PieChart"
Sync-UDElement -Id "ResultGrid"
} -ArgumentList $Period, $ReportType, $Departments
} -Stacked -Dynamic
I am also using a UDchart which has no problem whatsoever.