Table with ID does not update in a dynamic

Product: PowerShell Universal
Version: 4.1.7

Example:

New-UDDynamic -Id 'tabletest' -Content {
    $Data = Get-Date
    New-UDTable -Data $Data -Paging -Id "tabletest1"
    New-UDTable -Data $Data -Paging 
} 

New-UDButton -Text 'Refresh Table' -OnClick {
    Sync-UDElement -Id 'tabletest'
}

The table without an id updates. The table with an ID does not update.

This is pretty significant, as then I cannot use a table that I can update, and also get data from…

Raised a ticket, and got a workaround, for others that come across this:

Here’s a work around. It gets the ID of the table after the refresh so that retrieving the values always works.

New-UDDynamic -Id 'table' -Content {

    $Data = @(

        @{  Random = Get-Random }

        @{  Random = Get-Random }

        @{  Random = Get-Random }

        @{  Random = Get-Random }

        @{  Random = Get-Random }

    )

    $Page:Table = New-UDTable -Data $Data -Paging -ShowSelection

    $Page:Table

}



New-UDButton -Text 'Refresh Table' -OnClick {

    Sync-UDElement -Id 'table'

}



New-UDButton -Text 'Get data' -OnClick {

    Show-UDToast (Get-UDElement -Id $Page:Table.Id | ConvertTo-Json)

}