Issue with UDInputAction

I am attempting to have a user provide input and then based off of the input display a dynamic UDHeading, and UDGrid (hopefully multiple grids). If I use just the UDHeading everything works. However, if I add a grid or table then it stops working. After the user submits the input the card just displays a spinning progress circle.

Does anyone have any suggestions?
Here is a sample of code.

New-UDPage -Name 'Test Page' -Title "" -Icon _lock -AuthorizedRole @("Dev") -Content {
New-UDCard -Title "" -Content {
    New-UDInput -Title "" -Endpoint {
        param($UserName)
        $Session:UserName = $UserName

        New-UDInputAction -Content {

            $Name = (Get-ADUser -Identity $Session:UserName | Select-Object -Property
'Name').Name
            New-UDHeading -Text "You have selected $Name"

            New-UdGrid -Title "Processes" -Headers @("Name", "ID", "Working Set", "CPU") -Properties 
@("Name", "Id", "WorkingSet", "CPU") -AutoRefresh -RefreshInterval 60 -Endpoint {
                Get-Process | Select Name,ID,WorkingSet,CPU | Out-UDGridData
            }#end udgrid

        }#end udinput content

    }#end udinput endpoint

}#end udcard search

}#end udpage

Believe you need to define a layout for the contents of the card. I did the following for example and got results.

New-UDCard -Title '' -Content {
      New-UDInput -Title '' -Endpoint {
        param($UserName)
        $Session:UserName = $UserName

        New-UDInputAction -Content @(
          $Name = (Get-ADUser -Identity $Session:UserName -Properties Name).Name
          
          New-UDRow -Columns {
            New-UDColumn -size 6 -Content {
              New-UDHeading -Text "You have selected $Name"
            }
            New-UDColumn -size 6 -Content {
              New-UDGrid -Title 'Processes' -Headers @('Name', 'ID', 'Working Set', 'CPU') -Properties @('Name', 'Id', 'WorkingSet', 'CPU') -AutoRefresh -RefreshInterval 60 -Endpoint {
                Get-Process |
                Select-Object -Property Name, ID, WorkingSet, CPU |
                Out-UDGridData
              }#end udgrid
            }
          }
        )#end udinput content
      }#end udinput endpoint
    }#end udcard search
1 Like

@jorf Thanks! That is working.

I didn’t know you need to provide a layout for cards. Is this only when dealing with UDInputActions? I don’t recall seeing this in any of the documentation I have read.

Thanks again for your help!
guy

I’m honestly unsure, I don’t generally use cards in my dashboards but could see it being related to UDInputAction going through a sequence and not having somewhere defined to put it.

May Adam will pop in and provide some more insight. I’m still pretty new to all of this. Glad it worked though!

1 Like