How do I update one dropdown based on a UDselect in another?

I’m trying to make one UDselect update the options of one that follows. Such as in the first one, I choose a AD domain and the second should then show a list of choices relevant to that domain.
New-UDElement -Content {
New-UDSelect -Option {

} -onchange {
Sync-UDElement -Id “secondUDSelect”

However, the second UD select never shows the updated options. What should I do to make that work?