Hello,
is it possible to add the function for multiline Input to the New-UDTextbox Cmdlet?
I know that a textarea can be used as a UDInputField, but I cannot use the UDSelector in UDInput.
Another solution for me would be multiselect support for UDInputField -Type âselectâ!
That would be really perfect. Thank you so much!
Jens
Hey @stoni1989 I heard the word UDSelector
being mentioned
as the proud owner of this componentâŠI also recently released UDField recently to the marketplace, so you could use UDSelector and UDField to accomplish the goalâŠ?
Hey @psDevUK
thanks for the fast answer.
Can you help me to archive this?
Here is my current Code:
$query = âSELECT * FROM Zugehoerigkeitâ
$zugehoerigkeitTable = Invoke-Sqlcmd -Database $sqlDatabase -ServerInstance $sqlServer -Query $query
$hash = @()
foreach ($zu in $zugehoerigkeitTable)
{
$hash += @{
value = $zu.row_ID
label = $zu.zugehoerigkeit
}
}
New-UDInput -Id ânewSkillâ -Title âNeuer Skill anlegenâ -Content {
New-UDInputField -Name âSkillâ -Type âtextboxâ -Placeholder âSkillâ
New-UDSelector -Id âselectorâ -Options {$hash}
} -Endpoint {
param($Skill)
}
The UDSelector is not showing in my Dashbaord
How can i use the UDSelector inside the UDInput? Is this possible?
Thanks a lot
Jens
@stoni1989 one thing I can pretty much say for sure is anything is possible in UD
thatâs why I am such a supporter of this software module the mighty @adam releasedâŠok so just for clarification I have a working version here is my selection listâŠthat worksâŠ
New-UDCard -BackgroundColor "#8789c0" -Endpoint {
$query = @"
SELECT [ProductCode]
,[ProductName]
FROM COMPANY_DB
"@
$Products = Invoke-Sqlcmd2 -ServerInstance COMPANY_SERVER -Database COMPANY_DB -Query $query -Username USERNAME -Password PASSWORD
$hash = @()
foreach($item in $Products) {
$hash += @{
value = $item.ProductName
label = $item.ProductCode
}
}
New-UDSelector -id "selector1" -Options {
$hash
} -PlaceHolder "Select Product Codes..."
}
I am importing the invoke-sqlcmd2 from a function I import into my dashboardâŠnow you need some sort of button to obtain the selected results to then pass onto something elseâŠthis is how you do thatâŠ
New-UDButtonParticle -Id "Explode3" -Text "Search" -Color "#2e3d55" -BackgroundColor "#2e3d55" -Icon search -onClick {
function Get-UDSelectorValue {
param($SelectorId)
$value = (((Get-UDElement -Id $SelectorId).Attributes.selectedOption | Select-Object Root -ErrorAction SilentlyContinue) | ConvertTo-Json -Depth 2 | ConvertFrom-Json | Select-Object -ExpandProperty Root -ErrorAction SilentlyContinue) | Select-Object -First 1
if (!$value) {
$val = ((Get-UDElement -Id $SelectorId).Attributes.selectedOption | ConvertTo-Json -Depth 1 | ConvertFrom-Json | Select-Object -ExpandProperty SyncRoot) | Select-Object -ExpandProperty SyncRoot
$length = $val.length
$i = 0
Do {
if (($i % 2) -eq 0) {
$value += "'$($val[$i])'" + ","
}
$i++
}
While ($i -le $length)
$value = $value.TrimEnd(",")
}
return $value
}
$Selected = (Get-UDSelectorValue -SelectorId 'selector1') -replace ",''"
if (($Selected) -notmatch "\A'" )
{
$Selected = "'$Selected'"
}
Show-UDToast -Message "You selected $Selected" -duration 5000 -Position center
###sync other elements of your dashboard with this data
@("GridData9","InsideGrid9","pivot3") | Sync-UDElement
start-sleep -Seconds 5
}
So in this example PLEASE PLEASE note the ID parameter is crucial, it gets the selected values from the UDSelector then puts them in a $Session variable to then be passed to other objects on the dashboard to be populated with this informationâŠI hope this all makes sense? This code is working without issues for me. 
P.S the button particle is another
component I pushed to the marketplace
So here is a demo from the dashboard, I had to stop recording at the end as sensitive informationâŠbut it populates a grid and a pivot table from the product codes selected and the date range selectedâŠwhich is dynamically updated by syncâing the rest of the components on the page with the information gathered from the select and date selection.
The select list is holding thousands of items
@psDevUK I know
I havenât been using the dashboard for a long time but I love it!!!
The UDSelector works outside the UDInput but i need a multi select version inside the New-UDInput cmdlet
Thats my Problem.
The New-UDInputField -Type âselectâ doesnât support multi select right?
There is a New-UDTextbox cmdlet. Is it possible to create an AreaTextbox outside of UDInput with the same design as the textarea as an input field?
@adam Or can you add that as a feature request?
That you can create an area field with e.g. New-UDTextAreaBox.
Thanks
Jens
Jens why donât you scap using the New-UDinput and nesting everything in thereâŠand just call commands like https://poshud.com/New-UDTextbox to get the input information and use Get-UDElement to retrieve the data from each of the input fieldsâŠ?
Does this now make better sense to your problemâŠ? By nesting everything in New-UDInput that automatically creates the submit button for youâŠbut as you see in the code I shared above, you can get that information via a button you put on the page.
BTW @stoni1989 big changes for support of inputs coming in V3 so I am sure everything you want to do will be available in v3 but you can use the work-around method I suggested until then?
I try to describe my goal. I would like to create a skill management and / or a kind of learning platform. Here you should be able to create a new skill. The following things are queried when creating:
Skill (text box)
Category (multiselect)
Content (multiline text box)
And a few more. I have to get all of this on one page and then write it to a database with a click of the button.
That sounds good with the v3. Is there already an overview of what is changing?
Honestly @stoni1989 this can all be accomplishedâŠyou just need to use New-UDCard
then in that card nest https://poshud.com/New-UDTextbox to give you a text box, then in either the same card, or a new column or new row put the New-UDSelector
then repeat the process to add the multi-line text box, sure maybe UD-HELMET could style the textboxâŠthats my thoughts anyways
I am using UD for about 3 different databases at work read and write to⊠I donât have any v3 links off the top of my headâŠbut they are on this forum
found a link here Universal Dashboard v3 Progress
Thanks 
Iâll try tomorrow and get in touch again.
Have a nice day.
Jens
1 Like
I know this is a bit of an old thread but did you figure out how to do a multi line text box? It seems like it should be something simple but I canât seem to figure it out. Iâm trying some css styling to set the text box size and get it to drop to a new line when it fills the width but it doesnât seem to work with new-udtextbox.
Let me cook something upâŠ
I seen this https://alioguzhan.github.io/react-editext/ and seems to fit the bill so let me see if I can get this to work in UDâŠ
Nice that would be cool, Iâm guessing you can use it for a text area that spans multiple lines?
I put in a UDElement with a textarea tag for now.
New-UDElement -Id âFeedbackTextAreaâ -Tag âtextareaâ -Content {}
It doesnât look great but I might be able to style it a bit with some CSS
Though something fancier would be nice!
(Additional kudos to you for the UDFeedback module too!)
Might have to pop out for some ice-cream to fuel my brain for thisâŠbut I am just about to build it nowâŠwhen I looked at the npmjs example it looked like it relied on hooks, but the other page has an example with multi-line that auto growsâŠso trying that now, but I got an old laptop so initial build take a lil whileâŠreport back once built
Nice component Adam 
Do it work with forms ? as in do it get posted with the rest of the stuff?
The âotherâ adam, already added -multiline to the new-udtextbox in the UD 1.4 release 
Hello @McAndersDK damn didnât know about the multiline parameterâŠOk well I havenât really done much testing with this component yet as I only got it built late last nightâŠbut when you accept the text that you want to type, this is then saved to the state of TEXTâŠso cannot see why you wouldnât be able to use this in forms, as the data typed into the textbox is saved in the state. I will do a blog on it to cover all the parameters and how to use.
Sorry @adam or @McAndersDK I assume the multiline parameter is for Powershell Universal 1.4 yeah? Not Universal Dashboard�
1 Like
Did you use UD to make your blog site?
hey @PowerCode-K loving the icon picture
for the blog site I am hosting this on github using Jekyll so itâs all free, which is a word I loveâŠI actually got recommended it by @adam as I wanted to blog about his amazing software and to try help spread the wordâŠSadly at the moment I am not hosting anything externally on the web using UD. I wanted to for my company, but seems they would rather pay a 3rd party a crazy amount of money to do it insteadâŠ? 
P.S I have posted both the single line and multi line to the powershell gallery so they should appear on the marketplace within the hourâŠwill update blog a bit more about the single line component and parameters.
I now updated the associated blog here https://psdevuk.github.io/ud-flix/TextArea-Multi-Line-Input/ this should include all the information you need to start using either of these components on your dashboard 
2 Likes