Dynamically Update Values in Modal when open

Product: PowerShell Universal
Version: 2.10.2

I’m trying to update values within a modal basically like using a button to refresh it but I need it to happen automatically when an api call updates.

Here is a Sample of the Code and a screenshot of what im attempting to build.

function Node_Health  {
    param(
        $HostN,
        $Cluster
    )

    Hide-UDModal
    Show-UDModal -Content{
        New-UDDynamic -Content{
            $Cache:HostN = $HostN
            $Cache:Cluster = $Cluster
            $Cache:refresh = Invoke-RestMethod https://api.api.com/$Cache:cluster -Headers @{ Authorization = "Bearer $API"}
            Show-UDToast -Message "Refresh Running.."
            for ($i = 0; $i -lt $Cache:refresh.length; $i++){
                if ($Cache:refresh.HostName[$i] -like $Cache:HostN){
                    $Cache:CPUUtil = $Cache:refresh.NodeCPUUtil[$i]
                    $Cache:totCPU = $Cache:refresh.NodeCPUCap[$i]
                }
            }
            Show-UDToast -Message "Syncing Elements..."
            Sync-UDElement -Id 'CPU'
        } -AutoRefresh -AutoRefreshInterval 10

        New-UDPaper -Content{
            New-UDGrid -Container -Content{
                New-UDRow -Columns {
                    New-UDColumn -SmallSize 12 -Content{
                        New-UDTypography -Variant "h3" -text "$HostN"  -Style @{Color = '#aaaaad'; textAlign = 'center'} -Align center -NoWrap -Paragraph
                    }
                }
                New-UDPaper -Content{
                    New-UDGrid -Item -ExtraSmallSize 3 -Content{                               
                        New-UDRow -Columns{   
                            New-UDColumn -SmallSize 12 -Content{
                                New-UDTypography -Variant "subtitle2" -text "CPU" -Style @{Color = '#aaaaad'; textAlign = 'center'} -Align center -NoWrap -Paragraph 
                            }
                            New-UDColumn -SmallSize 12 -Content{  
                                New-UDDynamic -id "CPU" -Content{
                                    if($null -eq $Cache:CPUUtil){
                                        New-UDGrid -Container -Content{
                                            New-UDGrid -Item -ExtraSmallSize 4 -Content{}
                                            New-UDGrid -Item -ExtraSmallSize 4 -Content{
                                                New-UDGrid -Container -Content{
                                                    New-UDgrid -Item -ExtraSmallSize 4 -content{}
                                                    New-UDgrid -Item -ExtraSmallSize 8 -content{
                                                        New-UDProgress -Circular -Color "#4D2dc937"
                                                        New-UDElement -Tag 'div' -Endpoint{                                   
                                                            Start-Sleep 5
                                                            Sync-UDElement -id 'CPU'
                                                        }
                                                    }                               
                                                }                                                
                                            }
                                            New-UDGrid -Item -ExtraSmallSize 4 -Content{}
                                        } 
                                    }
                                    else{
                                        if ($Cache:CPUUtil -lt 45){
                                            New-UDTypography -Variant "h6" -text "$Cache:CPUUtil%"  -Style @{Color = '#2dc937'; textAlign = 'center'} -Align center -NoWrap -Paragraph                                                                                                
                                        }
                                        elseif (($Cache:CPUUtil -gt 45) -and ($Cache:CPUUtil -le 60) ){
                                            New-UDTypography -Variant "h6" -text "$Cache:CPUUtil%"   -Style @{Color =  "#adff2f"; textAlign = 'center'} -Align center -NoWrap -Paragraph                                                                                                
            
                                        }
                                        elseif(($Cache:CPUUtil -gt 60) -and ($Cache:CPUUtil -lt 75) ){
                                            New-UDTypography -Variant "h6" -text "$Cache:CPUUtil%"   -Style @{Color = '#e7b416'; textAlign = 'center'} -Align center -NoWrap -Paragraph                                                                                                
                                        }
                                        else{
                                            New-UDTypography -Variant "h6" -text "$Cache:CPUUtil%"   -Style @{Color = '#cc3232'; textAlign = 'center'} -Align center -NoWrap -Paragraph                                                                                                
                                        }                                                                                               
                                    }                                             
                                } -AutoRefresh -AutoRefreshInterval 5                                                                                      
                            }
                            New-UDColumn -SmallSize 12 -Content{
                                New-UDTypography -Variant "subtitle2" -text "of $Cache:totCPU" -Style @{Color = '#aaaaad'; textAlign = 'center'} -Align center -NoWrap -Paragraph                                                                                                
    
                            }
                            #Here to confirm if a refresh happened.
                            New-UDDynamic -Content {
                                New-UDColumn -SmallSize 12 -Content{
                                    New-UDTypography -Variant "subtitle2" -text "$Cache:CPUUtil" -Style @{Color = '#aaaaad'; textAlign = 'center'} -Align center -NoWrap -Paragraph                                                                                                
        
                                }
                            } -AutoRefresh -AutoRefreshInterval 15
                        }
                    }
                }
            }
        } 
    }
}

I have alot of my feedback and modal style elements broken out into modules so this is being passed as function back to the dashboard. The element this is loaded in is monitoring Cluster and Node health statistics for a hypervisor. And this part I’m working on will provide node health statistics. I have not been able to get this to reliably update when the modal is open. I see it run the API call but none of the values ever refresh. The API call only seems to refresh one time total. Has anyone ever successfully done this or can point me to where I’m going wrong?