Update Dashboard


I am using Universal Dashboard to display some automation tests results that get updated by the test agents. I am able to post the results via REST api directly, and get these stored into a cached variable. That is, I post the test info and create a tab, which I add to a cached collection of tabs to use later in the page (code below).
My question is, is there a way to “autoreload” the dashboard so that it creates an updated page with the latest info from the $cached:tabs Array. I use the dashboard as a windows service, so I can restart the service. I’d like to avoid this though, because it takes some time to get up and running and this is sort of a blank space for other results coming.

$i = New-UDEndpoint -Url "/i/" -Method "POST"  -Endpoint {
    $json =   $body 
    $tab = Get-TabObject -json $json
	if($cahce:tabs -ine $null){
		for ($i = 0; $i -lt $cache:tabs.Count; $i++){ 
			if($Cache:tabs[$i].text -ieq $tab.text){
        $cache:tabs = New-Object System.Collections.ArrayList 
	$null = $cache:tabs.Add($tab) 

Hello @EmilT and welcome to the UD forums…I believe the question you ask has already been answered here:- Idle Timeout Issues
Please remember if this does indded resolve your problem please mark this as the solution for future users. Thanks :slight_smile:


Maybe not related to your problem but there is a typo in your code:

if($cahce:tabs -ine $null){

Should be $cache instead of $cahce.


Thank you guys for the feedback. If I understand correctly, IdleTimeout has to do with extending the cache from expiring? My goal was something more akin the -Autoreload switch, that is the dashboard updating itself when it gets some data (I can hack this by pseudo editing the dashboard.ps1 file but like to think there is a cleaner way).
The main data bearing element is a UDTable, which uses -Content - should I be looking into using -Endpoint here?

Just a random idea, which I have used successfully. Depending on the amount of data, I can “store” the cached data into a serialized json (or xml) file, and read back from it, so cache expiration becomes a non-issue.

To get the data to update in a component such as the grid you need to make sure you use an endpoint and the autoreload and refreshinterval parameters on the endpoint script block. the component will then automatically update

1 Like

Yes, the endpoint was what I was looking for. Plus a few design considerations to fill in the right table in the right tab. Thanks again.

1 Like