UDGrid with linked cell values

Hi - This question is kind of a follow-on to my other post about linked table rows (Out-UDGridData with selectable rows?) - but this question is about trying to get the UDPage example to work using the “Dynamic Pages” example here: https://docs.universaldashboard.io/components/pages .

I can’t get it to work. When using the very first Dynamic Page example, with the following modifications, it won’t even load using Start-UDDashboard. It throws the error shown below the following example. I’m just trying to load the page so I can manually enter the URL in the address bar and get it to render.

New-UDPage -Name "aduser" -Url "/aduser/:username" -Endpoint {
  param ($username)
  New-UDCard -Title "Active Directory User`: $username" -Id "card1"

}

Error message during dashboard loading…

New-UDPage : Parameter set cannot be resolved using the specified named parameters.

At C:\testing\pages\aduser.ps1:1 char:1

  • New-UDPage -Name “aduser” -Url “/aduser/:username” -Endpoint {
  •   + CategoryInfo          : InvalidArgument: (:) [New-UDPage], ParameterBindingException
      + FullyQualifiedErrorId : AmbiguousParameterSet,UniversalDashboard.Cmdlets.NewPageCommand
    
    

Am I missing something?

Get rid of the -Name parameter. -Name and -Url are in separate parameter sets.

1 Like

That said, they don’t really have to be. It’s a weird implementation detail that we could fix in UD. But that’s probs what is happening.

1 Like

That fixed it. But I noticed that the $username value is set to “:jsmith” (with colon prefix). I thought that would be stripped off as a default. Am I misunderstanding the way the parameter is passed in via the URL string?

Hmmm. Nah thats weird. It shouldnt have the colon. I take it you’re not adding an extra colon in there?

Like the URL you are calling is /aduser/MyUserDude

The example I read shows something like /aduser/:username but I figured out removing the colon and it works fine. So far I’m happy. The option has opened up another door in my tiny brain, so it’s like another Lego kit to go with my older Lego kit. :slight_smile: