Hello all, I did some looking for this topic but wasn’t able to find anything.
I’m currently trying to create some dynamic pages in a tiered fashion from user inputs. EG: I have two or more dynamic pages starting at “/dynamic/” one being “/dynamic/:servername” and the next being “/dynamic/:servername/:newpage”.
Using New-UDInputAction -redirect will redirect to the correct url, however it seems the inner page doesn’t pull it’s own content from the separate page I set up for it, it always runs the content from the :servername page. Can I create dynamic sub-pages in this manner?
Here’s some sample code:
$Dynamic01 = New-UDPage -Url “/dynamic/:servername” -Endpoint {
param($servername)$ScriptColors = @{ BackgroundColor = "#5A5A5A" FontColor = "#FFFFFF" } New-UDCard @ScriptColors -Title "Welcome to a dynamic page, $servername!" -Text "This is a dynamic page. The content of the page is determined by the URL." New-UDInput -Title "newName Input Title" -id 'newName' -Content { New-UDInputField -Name "newName" -type select -Values $newName } -Endpoint { param($newName) New-UDInputAction -Toast "You chose: $newName" New-UDInputAction -RedirectUrl "/dynamic/$servername/$newName" }
}
$Dynamic02 = New-UDPage -Url “/dynamic/:servername/:newName” -endpoint {
New-UDCard -title ‘test’ -Text ‘dynamic02’
}