Criteria for getting data in a scheduled New-UDEndpoint to the Dashboard

Is there any kind of criteria for data processed periodically in an New-UDEndpoint and getting that data into the dashboard.

I have some processing script that will populate my dashboard 1 time. However when I wrap it inside a New-UDEndpoint -Schedule $BuildRefresh -Endpoint { Processing Script } the data does not get to the dashboard. I have the New-UDEndpoint outside of the New-UDDashboard.

thanks in advance.

Product: PowerShell Universal
Version: 1.4.6

How are you storing the data returned from the processing script? If you’re not already, you could use the $Cache scope to ensure the data is available everywhere.

Hi Adam,

That was helpful. I was not aware of the need for $Cache: to have the semicolon.
I had use $CacheDatalist = [System.Collections.Generic.List[pscustomobject]]::new() but once i changed that to

$Cache:datalist = [System.Collections.Generic.List[pscustomobject]]::new()

However, now it seems like the New-UDEndpoint that is defined does not run initially and my script that processes the data doesnt run inside the New-UDEndpoint. My dashboard comes back empy. I can tell its not running initially as the dashboard save and restart happens very quick and the dashboard is back up. Its not processing the portion inside the endpoint.

I have

$BuildRefresh = New-UDEndpointSchedule -Every 5  -Minute

New-UDEndpoint -Schedule $BuildRefresh -Endpoint {
     <Processing data into $Cache:datalist>

EDIT: I have waited at least 10 min and the Endpoint does not seem to run? What am I missing

Hoping somebody has some ideas what I might be doing wrong. I have a few dashboards that are set but just need them to re process data every so often.

My endpoint does not seem to be working.

Do I need to have the column and table and tab definitions in the endpoint?

How can I verify my endpoint is running per schedule?

Below is roughly the structure of the code

$variables set (some used inside endpoint)

$BuildRefresh = New-UDEndpointSchedule -Every 5  -Minute

New-UDEndpoint -Schedule $BuildRefresh -Endpoint {
     <Processing data into $Cache:datalist  >

$Columns = @(
  some columns defined

$gridapp = New-UDTable -Id 'gridapp' -Title "Release Information" -PageSize 40 -Columns $Columns -Data ($Cache:datalist | Where-Object -Property 'Type' -EQ "Mobile")

$tabs =     New-UDTabs -Tabs {
    New-UDTab -Id "tabapps" -Text "Applications" -Content {
        New-UDElement -Tag 'div' -Content { 

New-UDDashboard -Title 'Azure DevOps Build Versions' -Content { $tabs }