Table colum render wiping out data in 3.8.3

Product: PowerShell Universal
Version: 3.8.3

I have a table that pulls from a local SQLite DB and has a column that also includes a button to copy the data. On 3.7.x it worked fine. After upgrading to 3.8.3 the only thing that loads is the button. $eventdata for that specific column seems to be blank. If I remove the render it shows up correctly

$columns = @(
    New-UDTableColumn -Property FirstName -Title FirstName -IncludeInSearch
    New-UDTableColumn -Property MiddleName -Title MiddleName -IncludeInSearch
    New-UDTableColumn -Property LastName -Title LastName -IncludeInSearch
    New-UDTableColumn -Property samname -Title samname -IncludeInSearch -render {
        New-UDTypography -Text $eventdata.samname
        New-UDButton -Icon (New-UDIcon -Icon Copy) -onclick {
            Set-UDClipboard -Data $eventdata.samname
            Show-UDToast -Message "Copied!"
        }
    }
    New-UDTableColumn -Property Password -Title Password -render {
        New-UDTypography -Text $eventdata.password
        New-UDButton -Icon (New-UDIcon -Icon Copy) -onclick {
            Set-UDClipboard -Data $eventdata.password
            Show-UDToast -Message "Copied!"
        }
    }
)

    New-UDTable -Data $data -Columns $columns -PageSize $tablesize -StickyHeader -ShowSearch -ShowPagination

Just throwing some test data in it and everything seems to work… This is on 3.8.3

So, I don’t think there is anything inherently wrong with the functionality.

Any way to post some “sanitized” data, keeping any special characters in samname?

    $Data = @"
[
    {
        "FirstName":  "First 1",
        "MiddleName":  "Middle 1",
        "LastName":  "Last 1",
        "samname":  "Sam 1",
        "Password":  "Password 1"
    },
    {
        "FirstName":  "First 2",
        "MiddleName":  "Middle 2",
        "LastName":  "Last 2",
        "samname":  "Sam 2",
        "Password":  "Password 2"
    }
]
"@ | ConvertFrom-Json

I figured out why the data isn’t showing. Here is a sanitized row of the DB.There are a few extra fields on the table that I didn’t include in my original post.

All of these fields normally show up in the table, and were working correctly in 3.7.13. In 3.8.3 if I remove the last 4 fields from the table everything shows up fine. When I add them back I my issue returns. The table isn’t formatting the width and is truncating the text.

@adam did something change in the formatting of tables? Here is how it looks with all columns shown

and here is how it looks with a few columns removed.

With the limited columns it doesn’t truncate the samname and password text.

I see there is a -padding paremeter for New-UDTable, but can’t find any examples of how to use it. If that works how I think it does I should be able to put a value in there for padding pixels, right?

Weirdly enough it seems like $eventdata doesn’t even get populated when I have all columns shown. when the data is being truncated I would think I can still click the copy button and get the data, but it gives me an error saying it’s a null value

I was able to get this working correctly by specifying a width on the samname and password columns.

Are the columns supposed to automatically format themselves based on the data inside of them? Seems strange that $eventdata would be blank when the column width is too small to display the typography.

Updated to 3.8.7 today and removed the -width parameter and the issue did not return, so something else changed between 3.8.3 and 3.8.7. Either way it’s not an issue now.

1 Like