Table column not showing when named "Version"

I am trying to display a table with a column named “Version”, as in a software version number. It displays the column but all the entries are blank. I can reproduce simply by taking the sample code I found in the docs and changing ‘Protein’ to ‘Version’, like this:

New-UDDashboard -Title 'Table Test' -Content { 

    $Data = @( 
        @{Dessert = 'Frozen yoghurt'; Calories = 1; Fat = 6.0; Carbs = 24; Version = 4.0} 
        @{Dessert = 'Ice cream sandwich'; Calories = 159; Fat = 6.0; Carbs = 24; Version = 4.0} 
        @{Dessert = 'Eclair'; Calories = 159; Fat = 6.0; Carbs = 24; Version = 4.0} 
        @{Dessert = 'Cupcake'; Calories = 159; Fat = 6.0; Carbs = 24; Version = 4.0} 
        @{Dessert = 'Gingerbread'; Calories = 200; Fat = 6.0; Carbs = 24; Version = 4.0} 

    New-UDtable -Data $data 
Product: PowerShell Universal
Version: 2.3.2

Definitely a bug. I’ll open an issue for it.

I also found a similar bug, but I’m not sure if this one can be worked around or not in UD.
I’m using the Servicenow API to pull data in, one of the features of that API is dot walking across tables.
The problem is, the resulting variable name, might be something like ‘’ as a string, rather than object / property as you’d expect in powershell.
Addressing this in code, I’ll usually do something like $object.“”.

I’ve found that introducing variable names like this, will prevent any data from being returned.
As a workaround, I manipulate the data and variables names first, removing the dot, and then passing into Out-UDTableData, but because this is a dynamic/server-side table, I’m having to then also manipulate filters, search and sorting so that those variable names are converted back before passing back to the servicenow API.
The workaround is not an issue really, it’s just something to be aware of, but it would be cool if there was a way to handle this in UD automatically.
(Latest version of Universal & UD)

Thanks, Adam. For the time being, I worked around the issue in my dashboard by piping the objects from my data source through Select-Object and changing the name of the property to ‘CurrentVersion’. Then I used New-UDTableColumn to define columns for the table, and set the Title for the CurrentVersion property to ‘Version’. So for the user, it still looks like ‘Version’.

I’ll be glad to remove that ugliness when you get it fixed, though.

1 Like

Du you have an ETA on a fix for this issue?

I’ve pulled this into the v2.8 release so it will be available Feb 8th.