DeveloperMCT
DeveloperMCT

Reputation: 335

PowerApps: How to change the selected value of a drop down list via expression

I'm looking for a way to change the selected value of a drop down list through the OnSelect of a button. I would imagine this expression for the OnSelect would have worked:

dropDownList1.Selected.Value = "01"

...but it doesn't. I get no error or warning message. It just doesn't seem to do anything.

The drop down list has the following values: ["12","01","02","03","04","05","06","07","08","09","10","11"]

Thanks!

Upvotes: 5

Views: 41921

Answers (1)

SeaDude
SeaDude

Reputation: 4365

Try this:

  • dropDownList1
    • OnChange: Set(varDDValue, dropDownList1.Selected.Value)
  • button
    • OnSelect: Set(varDDValue, "whatevertheheckyouwant") (must be a value that is present in the dropdown Items property)
  • dropDownList1
    • Default: varDDValue

Upvotes: 6

Related Questions