Endpoint and Data Refreshing

I am looking for some help with refreshing data in a grid.
I read all I could regarding Endpoints and EndpointInitializaion, but its not sinking in for some reason.

I am working on a way to manipulate out load balancers via REST API. I have written some functions to help read the data, but am having issues when it comes to refreshing that data. Not the best at coding, but it works.

I currently have an external functions ps1 script that i load into my dashboard run script. I then setup a New-UDEndpointSchedule and an New-UDEndpoint, and a simple New-UDDashboard that displays a grid.

When I run the dashboard, everything loads except the grid data. When I enable UDlogging, I can see the the function is not loaded, I am thinking because I dont initialize the module? Not sure how to do this and initialize the endpoint?

import-module “Path to .ps1 functions” -force
$STM_FQDN = “HostName”
$TipSearchString = “XXX7”
$PoolSearchString = “XXX1”

$Schedule = New-UDEndpointSchedule -Every 30 -Second
$Endpoint = New-UDEndpoint -Schedule $Schedule -Endpoint {
$cache:Tips = Get-synTipStatus -STM_FQDN_Name $STM_FQDN -Search $TipSearchString

$dashboard = New-UDDashboard -Title “test” -Content {
New-UDGrid -title “Traffic IPs” -Headers @(“Name”, “IP Address”, “Active”, “Slave”, “Failover TIP”) -Properties @(“name”, “ipaddress”, “active”, “slaves”, “failover”) -NoFilter -Endpoint {
Cache:Tips | ForEach-Object { [PSCustomObject]@{ name = .name
ipaddress = _.ipaddress slaves =
active = $_.active
failover = New-UDButton -Text “Failover TIP”
} | Out-UDGridData
} -AutoRefresh -RefreshInterval 35
Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Port 10000 -Dashboard $Dashboard -Endpoint $Endpoint

Hi @xtremedew Ive posted a few scripts on github…most recently I posted

Which as you see was inspired off of this forum, hopefully this shows how to declare a function in an endpoint initialization to use throughout your dashboard. I also have some with endpoint demo on my github I hope this helps…?

# Set Variables, Modules, and Functions for Endpoint usage
  $VMF = New-UDEndpointInitialization -variable @("$dummy") `
    -Module @("Venom") `
    -Function @("Get-ArrayInfoDB", "Get-StorageCapacity")
$DB1 = New-UDDashboard -Title "Storage Dashboard  v1.0.5" `
  -Pages @( blah, blah)  `
  -Theme $tstorage -Footer $cfooter -FontColor "#FF0040" -EndpointInitialization $VMF

Are you setting -EndpointInitialization to reference your functions? Didn’t see it your code example.

So. I did finally get it working by adding in the EndpointInitialization on the New-UDDashboard, but I had to modify my functions as certain variables were not being seen. I assume this is due to the endpoints running in different runspaces? How would I go about making variables accessible to everything?

Thanks for the help, just trying to wrap my head around all of this.

Check out Adam’s recent blog about variables in UD. https://ironmansoftware.com/dude-wheres-my-variable-understanding-scoping-in-universal-dashboard/.
That should hopefully send you in the right direction.