I’m trying to update a variable based on which UDTab is selected but I don’t seem to be able to get it to update dynamically
In the example below, the tabs render the service name correctly in the -Text but the UDAlert is blank and the $Session:Service variable gets changed to blank
Yes, foreach ($service in $servicesListed) is in the script scope.
But because you set New-UDTab to dynamic, it runs the New-UDAlert in a different scope that have no access to the $service variable.
You should use a $session variable to share the data between the main scope and the dynamic tab scopes.
I don’t know if tabs support the Get-UDElement command. You can verify the data received with (Get-UDElement -Id $id | ConvertTo-Json).
Thanks everyone! I’m getting much closer but could still use some help
Context: This is to display current service incidents as reported by Microsoft’s message center for certain users who don’t have access to the admin centers. The tab titles list the services with issues and inside each tab it lists the specific events for each service
These are in a UDGrid, with the ‘details’ UDDynamic in another UDGrid
The top one works fine (‘All Services’), all incidents show as expected and when the UDChip is clicked, the ‘details’ pane updates properly with the incident message.
The others now display the UDChips, but end up setting the $Session: variables to null
I’m essentially hitting the microsoft graph api at graph.microsoft.com/beta/admin/serviceAnnouncement/issues every few minutes and storing the incidents in a database - I use the latest lastModifiedDateTime attribute in a ?filter= parameter as well
Anything I’m unsure of the formatting (the message content and title, so far) I just convert to base64 before inserting to the dbase and convert back when displaying in the dashboard