New-UDTableColumn and additional properties

Product: PowerShell Universal
Version: 1.5.0

I have started playing with moving some dashboards to Universal. In playing with tables, I am pulling data from SQL. In the New-UDTableColumn, is it possible to get other properties returned?

Here is my code:
$TableColumns = @(
New-UDTableColumn -Property ApplicationName -Title Name -Filter -Render {
$Item = $EventData
Write-Debug $Item
$ApplicationsPKID = Item.ApplicationsPKID New-UDLink -Id "link($EventData.ApplicationName)" -Text $EventData.ApplicationName -Url “/AppSupport/$ApplicationsPKID”
}
New-UDTableColumn -Property AppBriefDescription -Title Description -Filter -Search
New-UDTableColumn -Property VendorCompanyName -Title Vendor -Filter -Search
New-UDTableColumn -Property ProgrammingPlatform -Title Platform -Filter -Search
New-UDTableColumn -Property AppDeploymentStatus -Title Status -Filter -Search
)
$AppViewSQL = $AppViewSQL | Select-Object ApplicationName, AppBriefDescription, VendorCompanyName, ProgrammingPlatform, AppDeploymentStatus
New-UDTable -Data $AppViewSQL -Columns $TableColumns -Sort -Pagesize 150 -Search

In my first column, I am creating a link and I want to use the Primary Key to reference the dynamic page (instead of the application name). Is this possible to do on the fly like this with TableColumn?

I’m also having issues getting the -Pagesize to work. It will consistently only show me 10 rows.

The page size is a bug, i will open an issue for it, and for the first question, let me check and get back to you

the pageSize issue was fixed and I hope it will be in the next release.
I hope I understand you, basically, everything that you passed as data, you should have access to in the $EventData

for example

 $Data = Get-Process | Select-Object -Property ProcessName,WorkingSet,Id,VirtualMemorySize,Product
    $Columns = @(
        New-UDTableColumn -Property ProcessName -Title Name -Render {
            New-UDLink -Text $EventData.Product -Url “/Demo/$EventData.Product”
        }
        New-UDTableColumn -Property WorkingSet -Title WorkingSet
        New-UDTableColumn -Property Id -Title Id
        New-UDTableColumn -Property VirtualMemorySize -Title VirtualMemorySize
        
    )
    New-UDTable -Data $Data -Columns $Columns -PageSize 16

Ahh, it was my bad as I filtered out the SQL data too completely for the table columns.

Thanks for the quick look and fix on the pagesize, as well!

1 Like