Multiple select and New-UDSelector

Product: PowerShell Universal on IIS
Version: 1.5.14
  1. Is that a way to create a multiple select like this:

  2. I am tying to use New-UDSelector and getting the error “It is not possible to call a method on an expression that is NULL”. The module UniversalDashboard.UDSelector has been installed via marketplace.
    The following is my test code:

Import-Module -Name UniversalDashboard.UDSelector

New-UDCard -Content {
New-UDSelector -Id “stuff” -options {
@{ value = “merry”; label = “Merry” },
@{ value = “christmas”; label = “Christmas” },
@{ value = “everyone”; label = “Everyone” },
@{ value = “pal”; label = “Pal” }

Any help is appreciated. Thank you in advance!

I really need to get this work. But there is still this error! It is not possible to call a method on an expression that is NULL

I am trying similar scripts:

$hash = @()
$hash = @{ ID = 1; Shape = "Square"; Color = "Blue"}
New-UDCard -Content {
    New-UDSelector -id "stuff" -Options {

What am I doing wrong?
Can anyone please help.

Please look at this page here to learn how to use this component:-

this was built for Universal Dashboard not Powershell Universal. It will still work, but this was built sometime ago.

Thank you psDevUK for your reply.
I have simplifed the script to just this. It ist still not working

This is the error message at the console: It is not possible to call a method on an expression that is NULL

Is something missing? I am looking fowar for your help.

Try changing those double quotation mark characters (the and characters that look curly “) to just plain " or ' characters, to match the same ones used around Select Security Members... and Test_Function. Those curly style double quotation mark characters might be causing you grief.

thanks a lot for your hints Pharnos!
I replaced and with both " or ' and tried again. the same error occurs. :slightly_frowning_face:

Any more idea? Thanks in advance for any help!

New-UDSelect -Id 'stuff' -Label 'Stuff' -Multiple -Option {
    New-UDSelectOption -Name "Merry" -Value "merry"
    New-UDSelectOption -Name "Christmas" -Value "christmas"
    New-UDSelectOption -Name "Everyone" -Value "everyone"
} -OnChange {
    Show-UDToast -Message "dropdown changed to: $EventData" -Duration 5000

Thank you @pharnos for your prompt reply.
I found out: no more error rises when I add the parameter -Selected { }. It seems
that -Selected is obligatory even it is empty.

To your suggestion with New-UDSelect -Id ‘stuff’ -Multiple
I had tried this option before. But I need a button to get the values.
(Get-UDElement -Id ‘staff’’).value returns nothing

Have you a tip how to get those selected multiple values?

Really sorry for late reply, been busy on lots of different projects lately…Thank you @pharnos for your support in the matter.
Ok to get the values look here:-

which gives a demo on the readme…there is also useful comments on this forum. The -SELECTED parameter allows you to pre-select items from the list so you can have them already shown in the choice selected option. I got requested this but stupidly didn’t update the README to state it is a mandatory parameter. If you do not like this, then you can use the previous version. Hope this helps, again apologies on the delay just been a busy man…let me know if you need a bit more guidence thank you.