New-UDSelector (Multi Select) - Not displaying in 3.1.0

Hey Adam @psDevUK

Sorry to bother you. Does the UDSelector module work in Universal Automation?
I have been playing with it, but it keeps producing the following error:

You cannot call a method on a null-valued expression.

The code I am using is:

        $items = Invoke-Sqlcmd -ServerInstance server.mydomain.com -Query $myQuery
        $hash = @()
        foreach ($item in $items) { 
          $hash += @{ 
            value   = "$($item.id)(####)"
            label   = "$($item.name)(####)"
          }
        }
      Show-UDModal -Content { 
        New-UDCard -TItle 'Add New' -Content { 
          New-UDForm -Content { 
            New-UDSelector -Id "stuff" -Options {
               $hash
            } -PlaceHolder "Select Product Codes..."
          } -OnSubmit {
			#Nothing for now 
          }
        }
      }
Product: PowerShell Universal
Version: 3.1.0
1 Like

Hey @Mike27 as you probably noticed I kind of dropped of this forum and no longer make modules for this product. This is purely to not using it at my current work well for a long time now. I’m not sure if this works on latest version and sadly cannot test. I can dig out some examples though as I kept all my dashboard code. Sorry not much help and late reply just been busy

1 Like

No Worries! I appreciate your reply. I definitely understand, my week has been hectic! :slight_smile:

Not sure what New-UDSelector did but what about this? Select - PowerShell Universal

Hey @phunky1

Yeah, I use that in other areas of my dashboard, but it does not support multi-select.
Trying to cut down the clutter on some of my dashboards, however, I was able to get this working with New-UDAutoComplete and specifying the -multiple switch.

I use UDSelect with - multiple
See: universal-docs/New-UDSelect.txt at master · ironmansoftware/universal-docs · GitHub

-Multiple []
Whether you can select multiple values.

    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false

But at the Moment there seem to be an issue…

1 Like

Hi @Mike27 I’m searching through some files now…I don’t want to ask obvious…but have you checked out my REPO for this module as it does include some examples:-

I don’t have a working copy of software to test right now…

1 Like

Hey @psDevUK

Yep, I used this section as an example and copied the exact coding there, except changing the data to what my database would be returning.

Populating the list from SQL

I might revisit this, but the AutoComplete is working for now. Trying to get this project finished and out the door. lol :slight_smile:

Hey @Daniel
I swear the -Multiple switch was not there the other day. lol
I even opened a request on github and Adam gave me the work around to use New-UDAutoComplete in the meantime.