Can I update a dashboard from a UDEndpoint? I have a dashboard that I load with this:
Start-UDDashboard -Endpoint $Endpoint -Dashboard $dashboard -Port 10000 -AutoReload
This is the Dashboard:
$dashboard = New-UDDashboard -Title "TestingDash" -Content {
New-UDInput -Title "ID Number" -Endpoint {
param($ID)
If ($sqlData.EnrollmentStatusID -eq 7) {
New-UDInputAction -Content @(
New-UDCard -Title "Access Status" -Text "Yes" -BackgroundColor "Green" -FontColor 'white'
)
}
Else {
New-UDInputAction -Content @(
New-UDCard -Title "Access Status" -Text "No" -BackgroundColor "Red" -FontColor 'white'
)
}
}
}
I want to also be able to receive this ID number via a POST to the API Endpoint. I can already receive the number on the endpoint and store it into a variable.
$endpoint = New-UDEndpoint -Url "/process/:ID" -Method "POST" -Endpoint {
param($ID)
$ID #To Confirm the ID is received
If ($ID -eq 405827068) {
New-UDCard -Title "Access Status" -Text "Yes" -BackgroundColor "Green" -FontColor 'white'
}
Else {
New-UDCard -Title "Access Status" -Text "No" -BackgroundColor "Red" -FontColor 'white'
}
}
In that example I am feeding it a specific number, then if the number received equals the number I’m feeding it, I want it to update the dashboard to display the UDCard.