UDTable -Render get UDSelect details

Product: PowerShell Universal
Version: 3.0.6


I have a UDTable using columns, 1 column has rendering using a UDSelect. The table also has selections enabled for the rows. I know how to get the selected rows details, but how can I get the UDSelect value from each selected row?

Thanks for any help!

You’ll likely need to create deterministic IDs for the selects and look it up via Get-UDElement.

-Render {
    New-UDSelect -Id "Select_$($EventData.RowId)"

Then when you get the selections, you could do something like:

$Values = $Selections | ForEach-Object {
   (Get-UDElement -Id "Select_$($_.RowId)").Value


I am not getting the $eventData.RowId to show any value? The -Id just becomes Select_

Sorry. That was just an example. The RowID would need to be some identifying property on your objects. Is there anything you could use like that? What are you passing into the table?

Ok that makes sense then, I was looking for the RowID from PSU.

I still get no value, here is what I am doing.

$Columns = @(
                New-UDTableColumn -Property SubclientID -Title SubclientID -Filter -FilterType text -Width 250
                New-UDTableColumn -Property SubclientName -Title SubclientName -Filter -FilterType text -Width 250        
                New-UDTableColumn -Property InstanceName -Title InstanceName -Filter -FilterType 'text' -Width 250 
                New-UDTableColumn -Property Details -Title Details -Width 250 -Render {                    
                    New-UDSelect -Id "Select_$($EvenData.subclientid)" -Option {
                        foreach ($item in $OracleSchedules.task.taskname) {
                            New-UDSelectOption -Name $item -Value $item
                        New-UDSelectOption -Name 'NoSchedule' -Value 'NoSchedule'
                    } -DefaultValue 'NoSchedule'
            New-UDTable -Id 'table' -Columns $Columns -Data ($matchall | Select-Object instancename, subclientname, subclientid ) -ShowSelection 

Also looking at the selectedrows.rendereddetails shows a value but always has the default value only.

Looks like you have a typo:




Well I feel dumb now, looks like my VSCode was giving me that as an autocomplete and obviously I didn’t notice. Thanks! Looks good now, thanks for your help as usual.