I am trying the get the result from the select box and then get the value to be processed by my sql query next. However I just cannot get the value out? I have read the document on New-UDSelect and tried a few on the forum , still not working.
I can put an example together on getting the value…there is an easier way to do the SQL stuff…This drop down list can handle thousands of results from SQL…Need to find a script I was using…there is a lot of info on this thread on the forum:-
Boom…so glad I document stuff…please see the SQL sample in this README
I was using the New-UDSingleSelector, and that one doesn’t have “-Selected” parameter?
also, how can I get the value out? I was using
$selection = (Get-UDElement -id “stuff”).Attributes.selectedOption
$selection = (Get-UDElement -id “stuff”).Attributes.selectedOption | ConvertTo-Json | ConvertFrom-Json
I understand there was issues using this and PS7. So first question is are you using powershell 7?
Just want to verify that from using the above code, you did give the -id paramater the name "stuff"
The other week I finished my job…so I need to get PSU install on the wifes laptop as she got x64 and I am still on x86
I got a good few weeks till I start my next job, so I think it would make sense for me to rebuild both these components, include the additional -selected parameter for the single selection…I am also then hoping the light dark mode will work with it…
I know people do have this working in PSU, but I only ran it in UD…will attempt on Monday to get this up and running on the wifes laptop…so I can send an official answer…
You did try the function yeah?
Hi @qy2009 I have dealt with people running into issues whilst trying to use this component, but they seem to come through in the end, and get it working…I am seeing some slight syntax differences from how you are trying to read the value to how I have it documented in the link in the above post to my github page. I will attempt to get PSU running on my wifes laptop tomorrow and post a full on solution, if the demo files in the documentation are not working, as that was written for UD not PSU, so some slight adjustments might be required…I cannot promise this though as I also got four daughters to entertain tomorrow as well
Not sure if the code I got in this post will help?
Maybe you can update the document on UD-SingleSelector in future ? Then less people will be confused. Also, it will be really appreciated if you can add the default value parameter for UD-SingleSelector.
Enjoy your time with your family please! Family always come first
At least I can start working on the next few things now.