[1.4.5] New-UDTableColumn Render display "undefined"

Hi,

Since trying to use version 1.4.5, I have a problem with the Render parameter for “New-UDTableColumn” command which shows me for the column that uses “Render” the message “Undefined” for every line.
the code worked fine on version 1.4.4, but I wanted to benefit from the fix of the loading of the table during a search

$pages+= New-UDPage -Title “Order” -name ‘Order’ -Content {

$CSVPath = 'C:\path\file.csv' 

$data = import-csv -path $CSVPath -Delimiter ';' -Encoding utf8 | select inc,short_description,AssignGroupeDate,lastUpdateUsersGroup,priority,State,StateINC,assigned_to

$Columns = @(

    New-UDTableColumn -Property inc -Title inc

    New-UDTableColumn -Property lk -Title link -Render {  

    $Item = $Body | ConvertFrom-Json 

        New-UDLink -Url ("https://example.com/number=" + $Item.inc ) -Text ('link') -OpenInNewWindow

    }

    New-UDTableColumn -Property short_description -Title short_description

    New-UDTableColumn -Property AssignGroupeDate -Title AssignGroupeDate

    New-UDTableColumn -Property lastUpdateUsersGroup -Title lastUpdateUsersGroup

    New-UDTableColumn -Property priority -Title priority

    New-UDTableColumn -Property State -Title State

    New-UDTableColumn -Property StateINC -Title StateINC

    New-UDTableColumn -Property assigned_to -Title assigned_to

)

New-UDTable -Title "incident processing order" -Data $data -Columns $Columns

}

where is the error? is this a bug?
Can you help me please
thank you :slight_smile:

Hi
I had the same issue. You should write $EventData instead when using 1.4.5

Hi crni,
thank you for your help.

i have modified CSV file for add “link” column
i have modified dashboard script with “link” colulmn.
Now, the column “link” display only line of link text of CSV, but not hypertext link.
I have tested with New-UDButton but it’s same result.
it’s like the render parameter doesn’t work

$CSVPath = ‘C:\path\file.csv’

$data = import-csv -path $CSVPath -Delimiter ';' -Encoding utf8 | Select-Object inc,link,short_description,AssignGroupeDate,lastUpdateUsersGroup,priority,State,StateINC,assigned_to

$CountCSVPath = ($data | measure-object).count



$Columns = @(

   New-UDTableColumn -Property inc -Title inc

   New-UDTableColumn -Property link -title link -Render { New-UDLink -Url $EventData.link -Text 'link'}

   New-UDTableColumn -Property short_description -Title short_description

   New-UDTableColumn -Property AssignGroupeDate -Title AssignGroupeDate

   New-UDTableColumn -Property lastUpdateUsersGroup -Title lastUpdateUsersGroup

   New-UDTableColumn -Property priority -Title priority

   New-UDTableColumn -Property State -Title State

   New-UDTableColumn -Property StateINC -Title StateINC

   New-UDTableColumn -Property assigned_to -Title assigned_to

)

New-UDTable -Title "incident processing order" -Data $data -PageSize $CountCSVPath -Search -Columns $Columns

You don’t have a property called “lk” in your data

Hi crni,
thank you for your help.

i have modified CSV file for add “link” column
i have modified dashboard script with “link” colulmn.
Now, the column “link” display only line of link text of CSV, but not hypertext link.
I have tested with New-UDButton but it’s same result.
it’s like the render parameter doesn’t work

$CSVPath = 'C:\path\file.csv' 

    $data = import-csv -path $CSVPath -Delimiter ';' -Encoding utf8 | Select-Object inc,link,short_description,AssignGroupeDate,lastUpdateUsersGroup,priority,State,StateINC,assigned_to

    $CountCSVPath = ($data | measure-object).count

    

    $Columns = @(

       New-UDTableColumn -Property inc -Title inc

       New-UDTableColumn -Property link -title link -Render { New-UDLink -Url $EventData.link -Text 'link'}

       New-UDTableColumn -Property short_description -Title short_description

       New-UDTableColumn -Property AssignGroupeDate -Title AssignGroupeDate

       New-UDTableColumn -Property lastUpdateUsersGroup -Title lastUpdateUsersGroup

       New-UDTableColumn -Property priority -Title priority

       New-UDTableColumn -Property State -Title State

       New-UDTableColumn -Property StateINC -Title StateINC

       New-UDTableColumn -Property assigned_to -Title assigned_to

   )

      

    New-UDTable -Title "incident processing order" -Data $data -PageSize $CountCSVPath -Search -Columns $Columns

I had this issue with a table earlier. The issue I found was that the variable contained more information than was being looked for by the table. So everything returned undefined. Using the same variable I used | select for the data I wanted and it fixed the issue.

so I would say try:

New-UDTableColumn -Property link -title link -Render { New-UDLink -Url ($EventData.link | select link) -Text ‘link’}

This is an example but I would look at what properties are in $EVENTDATA.LINK make sure you select the right thing. Or maybe its under another array in there.

Hi SnV,
thank you for your help.

i have test your solution, but, the column “link” display only line of link text of CSV, but not hypertext link.

i have tested with other url link :
New-UDTableColumn -Property link -Render {New-UDLink -Url ‘https://google.fr’ -Text ‘test’ }

it always shows me “link” text of CSV in column “link” but never Link with “test” text

I also tested this with the same result

New-UDTableColumn -Property link -title link -Render { New-UDLink -Url (($EventData| select link).link) -Text ‘link’}

I think it’s a bug
what do you think?

This is a bug. This issue has a work around: https://github.com/ironmansoftware/powershell-universal/issues/68

This will be fixed in 1.4.6.

1 Like

thank’s Adam

With 1.4.6, this bug is fixed