FilterFields Parameter for UDTable?

Hey guys, looking to display data based on some cache variables in UDTable based on a dropdown selection, was curious if there was such a thing, like there is in New-UDChart endpoint.

There currently isn’t this option available. You could do something similar by building the filtering controls yourself but it’s a bit more work.

Here’s an example of how to do that: https://poshtools.com/2018/11/13/dynamically-updating-controls-with-sync-udelement/

I’m using a chart and table in that example but you could do the same with a UDTable.

Thanks, so I’ve gone a head and gave this a shot, and this worked, did notice 2 things, there was a lag of somewhat 2sec (on each change), for what it is, $cache:DiskSpace only contains about 20 line items, and 2, show-udtoast did not appear.

New-UDCard -BackgroundColor "#FF252525" -Content {
New-UDSelect -Label "Select a role:" -Option {

    New-UDSelectOption -name "Group1" -Value 1 -Selected
    New-UDSelectOption -name "Group2" -Value 2
    New-UDSelectOption -name "Group3" -Value 3
    New-UDSelectOption -name "ALL" -Value 4
} -OnChange {
    switch ($EventData) {
        "1" {$session:RoleSelected = $cache:DiskSpace | ? Role -like "*Group1*"; Show-UDToast -Message $EventData-Title "ED" -Position "topRight"; Sync-UDElement -id chart}
        "2" {$session:RoleSelected = $cache:DiskSpace | ? Role -like "*Group2*"; Show-UDToast -Message $EventData-Title "ED" -Position "topRight"; Sync-UDElement -id chart}
        "3" {$session:RoleSelected = $cache:DiskSpace | ? Role -like "*Group3*"; Show-UDToast -Message $EventData -Title "ED" -Position "topRight"; Sync-UDElement -id chart}
        "4" {$session:RoleSelected = $cache:DiskSpace ; Show-UDToast -Message $EventData -Title "ED" -Position "topRight"; Sync-UDElement -id chart}
          
    }
}
}


New-udtable -id chart -headers @("Role", "ComputerName", "Name", "Label", "Capacity", "Free", "PercentFree", "FileSystem", "Type", "BlockSize") -AutoRefresh -FontColor "#FFFFFFFF" -BackgroundColor "#FF252525" -endpoint {
if ($Session:RoleSelected -eq $null) {
    $Session:RoleSelected = $cache:DiskSpace
}
$session:RoleSelected  | out-udtabledata -Property @("Role", "ComputerName", "Name", "Label", "Capacity", "Free", "PercentFree", "FileSystem", "Type", "BlockSize")
}

Update: so just wanted to update on performance, attempted the same behavior against a larger dataset and pretty much froze the entire browser, eventually did come back after 40sec, is there something else that can be tried?

Can you open the developer tools in your browser (F12) and then go to the network tab. Can you watch that tab for requests and find the one that sends the data? Can you see if it’s a ton of data?