Output Endpoint Return Variable (Array) into Textbox or Paragraph element

I’m working on a tool that will provide me with all of the SANs associated with a Load Balancer server. This will help me when adding new sites to the load balancer and requesting HTTPS cert updates with the newly added sites.

I’ve created an endpoint with my initial script that I’ve test prior to implementation for desired results. The issue I’m running into currently is how to output the return value(Array) into something that the user can see on the UD page.

Right now I’m Caching the return variable in the Endpoint like so:

$Cache:SANSArray = @()
foreach ($san in $SANs){
    $Cache:SANSArray += $san
}

return($Cache:SANSArray) 

In my SANS Tool, I’m then trying to just use that array in my output of a New-UDParagraph element.

$SANs = $Cache:SANSArray

New-UDInputAction -Content @(
   New-UDCard @Colors -Title "All SANs for $ServerFQDN" -Content {
       New-UDParagraph -Text "$SANs"
   }
)

But when I run the tool with all the correct information it just endlessly spins.

Dashboard Logs show that the request finished and that the contents of the array are being returned but it never actually outputs anything it just endlessly loads.

Anyone had success with passing a variable to an output like this?

As a note this array is a comma seperated list of Domain Names like

sitename1.domain.com,sitename2.domain.com,sitename3.domain.com

hey @aggiebeckett it’s 23:33 where I am and I feel on a roll…would love to help you out with this I know data is sensitive, but can you provide more code, so I can try and replicate something my end, then post it on github the solution…I figure as this is such an evolving product I’m trying to put as many examples to problems I people have. I currently have only 2 solutions on my github ud script page lets make this one the 3rd…

You bet @psDevUK I will sanitize the code and post something a bit later. Thanks for offering to take a look.

no worries @aggiebeckett it might not be until the morning I get to look at it, as it is late now…but figure if I can put a repository of how to’s then might save people a lot of time and head-scratching…I know when I used the heat-map it took me ages to figure out how to get the code into the format nivo heat map wanted it in…so just need a bit more code to understand what your trying to do then hopefully make you the 3rd how-to :slight_smile: