New-UDTable Hide Column

I am creating a table in PSU to get messages out of the Exchange online Quarantine which is all working fine but some of the columns contain very long strings which aren’t important but I would like to include them in the export.

So in the web portal I would like Sender, recipient subject etc. but in the export I would still like to have message-id, Identity, expiry date and other details.

I have tried setting the column Width to 0 and the truncate switch

                New-UDElement -tag 'div' -id 'QuarantinePage' -Content {
                    $columns = @(
                        New-UDTableColumn -Title 'ReceivedTime' -Property 'ReceivedTime' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'SenderAddress' -Property 'SenderAddress' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'RecipientAddress' -Property 'RecipientAddress' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'Subject' -Property 'Subject' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'Size' -Property 'Size' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'Type' -Property 'Type' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'ReleaseStatus' -Property 'ReleaseStatus' -IncludeInSearch -IncludeInExport
                        New-UDTableColumn -Title 'MessageId' -Property 'MessageId' -IncludeInSearch -IncludeInExport -Width 0 -Truncate
                        New-UDTableColumn -Title 'GetHeaders' -Property 'GetHeaders' -Render {
                            New-UDButton -Text 'GetHeaders' -id "btnHeader"  -OnClick {
                                $headers = $eventdata.MessageHeader
                                Set-UDElement -Id 'QuarantinePage' -Content {
                                    New-UDPaper  -Children {
                                        New-UDHtml -Markup ($headers -replace "`r`n", '<br>')
                                    }
                                    New-UDButton -Text 'Back' -OnClick {
                                        Set-UDElement -Id 'QuarantinePage' -Content {
                                            New-UDTable -Data $CustomTable -Id 'QuarantinedMessages' -Title 'Quarantined Messages' -Columns $columns -ShowSort -ShowFilter -ShowPagination -ShowSelection -Export -ShowSearch
                                        }
                                    }
                                }
                            }
                        }
                        New-UDTableColumn -Title 'GetPreview' -Property 'GetPreview' -Render {
                            New-UDButton -Text 'GetPreview' -id "btnPreview"  -OnClick {
                                $Body = $eventdata.MessagePreview
                                Set-UDElement -Id 'QuarantinePage' -Content {
                                    New-UDPaper  -Children {
                                        New-UDHtml -Markup ($Body -replace "`r`n", '<br>')
                                    }
                                    New-UDButton -Text 'Back' -OnClick {
                                        Set-UDElement -Id 'QuarantinePage' -Content {
                                            New-UDTable -Data $CustomTable -Id 'QuarantinedMessages' -Title 'Quarantined Messages' -Columns $columns -ShowSort -ShowFilter -ShowPagination -ShowSelection -Export -ShowSearch
                                        }
                                    }
                                }
                            }
                        }
                    )
                    New-UDTable -Data $CustomTable -Id 'QuarantinedMessages' -Title 'Quarantined Messages' -Columns $columns -ShowSort -ShowFilter -ShowPagination -ShowSelection -Export -ShowSearch
                }
Product: PowerShell Universal
Version: 2.1.1

Did you ever figure this out? I am looking to do the same thing. Thank you.

I forgot to mention, I am using the Server-Side Exporting. It would be nice to have the onexport server-side export whatever is being passed to it.

New-UDTableColumn will have a -Hidden parameter to support this use case in 2.3.0.

2 Likes