Set-UDElement with UDSelects

I have been doing some browsing on the forum this morning, and have seen similar questions asked, but nothing that seemed like a straightforward answer. If I create a UDSelect and populate it with the days of the week, for example, I have yet to find the correct syntax to set the value based off other information. Just using something like Set-UDElement -Id “MySelect” -Attributes @{value=“Thursday”} does not work on a select, whereas it does on a textbox. Is there a different way to select the item you want in the select, by index perhaps? I tried creating a dynamic region, and setting the -DefaultValue on button click, but this did not work either.

Product: PowerShell Universal
Version: 1.5.11

Just an update, I tried removing and recreating the element, to set the defaultvalue to what I need it to be, but that does not seem to work either.

Just a heads up that I’ve been trying to figure this out and it’s not working as expected. It’s certainly a bug but I haven’t been able to crack a fix for it quite yet.

Thanks, @adam. As an FYI, I did try following the article here:

https://blog.ironmansoftware.com/universal-dashboard-dynamic-forms/

The example of one select feeding another works, but cannot seem to get it to queue off a button. I appreciate you looking into it.

1 Like

@adam Just checking back, any thoughts on this one? I’ve been playing around with it, but cannot find a way to populate unless I do one select feeding another.

Sorry. This was never resolved. I’m opening a public issue so we can track this and get it assigned: Set-UDElement doesn't work with New-UDSelect · Issue #93 · ironmansoftware/issues · GitHub

1 Like