Set-UDElement Value is null

Not sure if this is a bug or something I’m doing wrong but when I use, for example:

Set-UDElement -Id 'txtfirstName' -Properties @{
       Value = $firstName
}

The actual value of the textbox is still null when I view the $body (this is in a New-UDForm)

Is this something I’m doing wrong? As a workaround, I’m having to get the value again by using:
$Value = (Get-UDElement -Id 'txtfirstName').value in the -OnSubmit block

Seems like a bug. It’s not updating the “form context” that we use internally to track state so that’s why it’s failing to return in $body

Ah okay, thanks for the clarification.