The UDTable in v3 is not working for my data I gathered from an custom API using my own PSModule.
The table examples from the hosted doc are working fine but I cannot figure out what I am doing wrong as the data are just strings (ID, Name, Description).
The table is displayed but all rows are empty.
$Columns = @(
New-UDTableColumn -Property ID -Title ID -Render {
$Item = ConvertFrom-Json $Body -Depth 10
New-UDLink -Url "/object/datawarehouse/objecttype/$($Item.ID)"
}
New-UDTableColumn -Property Name -Title Name
New-UDTableColumn -Property Description -Title Description
)
$Table = New-UDTable -Data @(Get-ADWDWObjectType | Select ID, Name, Description) -Columns $Columns
ConvertTo-Json $Table
{
"loadData": null,
"sort": false,
"id": "5a6ac42b-042f-4e7e-a34f-b14e3e9b265f",
"type": "mu-table",
"data": [
{
"ID": "162c27f4-7ad1-4a6c-b62c-20090151dcc7",
"Name": "AttributeTesting",
"Description": null
},
{
"ID": "1c229a64-d499-4d91-9102-829412efb6b0",
"Name": "test",
"Description": "testing"
},
{
"ID": "52103d0b-3144-4fe3-aa94-e3f986926e7c",
"Name": "Auto",
"Description": null
},
{
"ID": "72ae0e64-c35c-4a0a-aad1-39e056c51d48",
"Name": "Person",
"Description": null
},
{
"ID": "9a166c5b-0ddf-4759-84b0-b7c15c4d59bd",
"Name": "Person2",
"Description": null
}
],
"columns": [
{
"id": "d357340c-e11a-496a-af51-4138971a01f4",
"render": "d357340c-e11a-496a-af51-4138971a01f4",
"filter": true,
"sort": true,
"search": true,
"field": "id",
"title": "ID"
},
{
"id": "9c589f65-7239-42be-b8a3-e72cfc11fdab",
"render": null,
"filter": true,
"sort": true,
"search": true,
"field": "name",
"title": "Name"
},
{
"id": "c51b1c96-2544-45d4-a9b1-33318a58c02c",
"render": null,
"filter": true,
"sort": true,
"search": true,
"field": "description",
"title": "Description"
}
],
"search": false,
"export": false,
"isPlugin": true,
"filter": false,
"title": "",
"assetId": "index.2852b6957e0dcf5ad8c2.bundle.js"
}
The raw data looks like this:
ConvertTo-Json (Get-ADWDWObjectType) -Depth 10
[
{
"Name": "AttributeTesting",
"Description": null,
"ID": "162c27f4-7ad1-4a6c-b62c-20090151dcc7"
},
{
"Name": "test",
"Description": "testing",
"ID": "1c229a64-d499-4d91-9102-829412efb6b0"
},
{
"Name": "Auto",
"Description": null,
"ID": "52103d0b-3144-4fe3-aa94-e3f986926e7c"
},
{
"Name": "Person",
"Description": null,
"ID": "72ae0e64-c35c-4a0a-aad1-39e056c51d48"
},
{
"Name": "Person2",
"Description": null,
"ID": "9a166c5b-0ddf-4759-84b0-b7c15c4d59bd"
}
]