Set the value of "New-UDInputField" based on query parameter


is it possible to set the value of my text field based on a query parameter? should set the value of my Email text input to

I’ve tried using Invoke-UDJavaScript with document.getElementById("Email").value = ''; which actually sets the text but in the submit the value itself is empty.

 New-UDInput -Id "Form" -SubmitText "Continue" -Validate -Content {
        New-UDInputField -Type 'textbox' -Name 'Email' -Placeholder 'E-Mail'
      } -Endpoint {}

Hello @tiwood I developed a component called New-UDField it is right here to download:-
The repo for this module is here:-
The 2nd example in the readme shows how to set values of the fields based on an input. I hope this answers your question, as I know this would work. Peace

Hi, thanks for your Input!

I’ve opted for the following solution:

#// functions.ps1
function ConvertReferer-ToQueryStrings {
  param (

  $hashtable = New-Object hashtable

  $Referer -split "\?" | Where-Object { $_ -like "*=*"} | ForEach-Object { $_ -split "&" } | ForEach-Object {
    $kv = $_ -split "="
    $k = $kv[0]
    $v = $kv[1]
    $null = $hashtable.Add($k, $v)

  return $hashtable

#// dashboard.ps1
  New-UDColumn -Size 6 -Endpoint {

    if ($request.Headers["referer"]) {
      $queryStrings = ConvertReferer-ToQueryStrings -Referer $request.Headers["referer"]
      if ($queryStrings["email"]) {
        $EmailPreset = $queryStrings["email"]
      } else {
        $EmailPreset = $null

      New-UDInput -Id "Form" -SubmitText "Next" -Content {
        New-UDInputField -Type 'textbox' -Name 'Email' -Placeholder 'E-Mail' -DefaultValue $EmailPreset
      } -Endpoint ([scriptblock]::Create((Get-Content -Path "$($dashboardRoot)/endpoints/RedeemInvite.ps1" -Raw)))