New-UDSelect -MultiSelect read selected values

Need help … doing something like this:

New-UDSelect -ID ‘DB_Application’ -MultiSelect -Label ‘Datenbank/SQL’ -Option {
foreach ( $db in $dbs ) {
New-UDSelectOption -Name $db -Value $db
}
}
Works fine; I do get a Multi-Selct box …

Now I want to read the selected Values … I am to stupid for this …
Both (-Name and -Value) is the same string (eg. “DB 1”, “DB 2”, “DB 3” etc.)
String not Integer Value …

later do this:

$helper=get-UDElement -id “DB_Application”
$myvalue=$helper.Attributes[‘value’]
Show-UDToast -Message “Debug: $myvalue” -Duration 5000

as Long, as I do select ony one value it Looks fine … I get “DB 1” in message
Selecting two or more values I only get last seleced …

P.S.:
Tried several differend Loops … no success …

####################################################################################################################################################

Page

$global:mypage = New-UDPage -ID mypage -Name “mypage” -Endpoint {

  # Input usualy from Database ...
  $dbs=@("DB1","DB2","DB3")

  # Card
  New-UDCard  -Content {

     # Select
     New-UDSelect -ID ‘myselect’ -MultiSelect -Label ‘select me’ -Option {
        foreach ( $db in $dbs ) {
           New-UDSelectOption -Name $db -Value $db
        }
     }

     # Button
     New-UDButton -Icon ticket -Text "Button" -OnClick {      
        $helfer=get-UDElement -id "myselect"
        $myvar=$helfer.Attributes['value']
        Show-UDToast -Message "Debug $myvar" -Duration 5000 -BackgroundColor red         
     }
  }

}

####################################################################################################################################################

MAIN

$Dashboard = New-UDDashboard -Title “Multiselect” -Page $global:mypage
Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Dashboard $Dashboard -Port 10000 -AllowHttpForLogin

This is working … seems complicated …

$global:mypage = New-UDPage -ID mypage -Name “mypage” -Endpoint {

  # Input usualy from Database ...
   $dbs=@()

   $zeile = @{
     name   = 'Name1'
     nummer = '1'
   }                       
   $dbs=$dbs+$zeile

   $zeile = @{
      name   = 'Name2'
      nummer = '2'
   }                       
   $dbs=$dbs+$zeile

   $zeile = @{
     name   = 'Name3'
     nummer = '3'
   }                       
   $dbs=$dbs+$zeile 

  # Card
  New-UDCard  -Content {

     # Select
     New-UDSelect -ID ‘myselect’ -MultiSelect -Label ‘select me’ -Option {
        foreach ( $werte in $dbs ) {
           New-UDSelectOption -Name $werte.name -Value $werte.nummer
        }
     }

     # Button
     New-UDButton -Icon ticket -Text "Button" -OnClick {      


        $helfer=get-UDElement -id "myselect"
        $myvar=$helfer.Attributes['value']
         
        $myvar=$myvar.Replace('"','')
        $myvar=$myvar.Replace('[','')
        $myvar=$myvar.Replace(']','')

        $helfer=$myvar.split(',')
        foreach ($wert in $helfer ) { 
           Show-UDToast -Message "Debug $wert" -Duration 5000 -BackgroundColor red         
        }

     }
  }

}