Product: PowerShell Universal
Version: 4.0.0-beta2 (4792583120)
Installation: IIS (From zip)
All of the tables across my dashboards that load their data from external sources (SQL in this case) display ‘No Data’.
This happens whenever I use the -LoadData
parameter.
Using an example from the docs page to demonstrate this.
New-UDApp -Title 'PowerShell Universal' -Pages @(
# Create a page using the menu to the right ->
# Reference the page here with Get-UDPage
New-UDPage -Name 'Home' -Content {
New-UDButton -Text 'Table1' -OnClick { Sync-UDElement -Id 'Table1' }
$Columns = @(
New-UDTableColumn -Property Name -Title "Name" -ShowFilter -Render { $EventData.Name }
New-UDTableColumn -Property Value -Title "Value" -ShowFilter
)
New-UDTable -Columns $Columns -LoadData {
$Data = 1..1000 | ForEach-Object {
@{
Name = "Record-$_"
Value = $_
}
}
foreach($Filter in $EventData.Filters)
{
$Data = $Data | Where-Object -Property $Filter.Id -Match -Value $Filter.Value
}
$TotalCount = $Data.Count
if (-not [string]::IsNullOrEmpty($EventData.OrderBy))
{
$Descending = $EventData.OrderDirection -ne 'asc'
$Data = $Data | Sort-Object -Property $EventData.orderBy -Descending:$Descending
}
$Data = $Data | Select-Object -First $EventData.PageSize -Skip ($EventData.Page * $EventData.PageSize)
$Data | Out-UDTableData -Page $EventData.Page -TotalCount $TotalCount -Properties $EventData.Properties
} -ShowFilter -ShowSort -ShowPagination -Id 'Table1'
}
) -HideUserName
Am I doing something wrong?