Pre filed New-UDInputField


#1

Hi,

It possible, to get s new option for create prefilet “New-UDInputField” fields, I’m creating a page for edit “User informatiion” and want to show prefilled “DisplayName”, “FirstName” and “LastName” fields.

Will that available in a feature update?


#2

Hi @ARKO,

there is already a parameter called “-DefaultValue”:

Get-UDDashboard | Stop-UDDashboard
$pages = @()
$pages += New-UDPage -Name 'main' -Content {
    New-UDRow -Endpoint {
        $dn = 'User123456'
        $fn = 'John'
        $ln = 'Doe'

        New-UDInput -Title "Simple Form" -Id "Form" -Content {
            New-UDInputField -Type 'textbox' -Name 'DisplayName' -DefaultValue $dn
            New-UDInputField -Type 'textbox' -Name 'FirstName' -DefaultValue $fn
            New-UDInputField -Type 'textbox' -Name 'LastName' -DefaultValue $ln
        } -Endpoint {
            param($DisplayName, $FirstName, $LastName)
            
            #your code here#

            #sample output
            New-UDInputAction -Toast "DisplayName: $DisplayName, FirstName: $FirstName, LastName: $LastName" -Duration 5000
        }
    }
}


$dashboard = New-UDDashboard -Title "main" -Pages $pages 

Start-UDDashboard -Port 20000 -Dashboard $dashboard