New-UDTable data not refreshing

Product: PowerShell Universal
Version: 3.2.6

I’m having trouble understanding how to get a table to refresh, between old forums posts, new docs, and github. I have been following this: Table - PowerShell Universal

Can anyone help me understand why this isn’t refreshing?

Here’s an extremely simplified version, let me know if I am missing something:

 $page = new-udpage -name 'page' -content {
     New-UDDynamic -Id 'dynamic' -content {
        $columns = @(
            new-udtablecolumn -property rename -render {
                new-udbutton -onclick {
                    sync-udelement -Id 'dynamic'
                }
            }
            
            new-udtablecolumn -property column2
        )

        new-udtable -columns $columns -loaddata {
            $logic = get-date #logic happens here
        }
    }
} 

$logic is not refreshing for me until much later, minutes or longer.

First, I would only put the table in the Dynamic region.

Second, have you tried just doing New-UDTable -Data?

$page = new-udpage -name 'page' -content {
    $columns = @(
        new-udtablecolumn -property rename -render {
            new-udbutton -onclick {
                sync-udelement -Id 'dynamic'
            }
        }
        new-udtablecolumn -property column2
    )
    New-UDDynamic -Id 'dynamic' -content {
        $logic = get-date #logic happens here
        new-udtable -columns $columns -data $logic
    }
} 

The difference here is that it’s defining the columns (which won’t change), and then loading the data for the table, then assigning it. -LoadData for more advanced circumstances where you want to write load data on the fly. For example, writing the logic to search a SQL database and pull data based on the current state of the table.

I will try -Data again, I was having trouble and thought I needed -LoadData since it didn’t seem to be behaving. My refresh takes a little bit so I wasn’t sure which to use.