How to Set the Drop Down default value in PowerApps

Drop down controls are used in almost all PowerApps and often times I can spot a rookie app when the users previous choices are not persisted. This sometimes breaks data integrity when the user edits the record and the drop down users value gets lost on the edit form. In this post your will learn how to set the drop down default value in PowerApps. Continue reading to become an Office Power User! 

Animated image showing the default drop down in action using PowerApps

To create the demo above insert the following controls and change properties as prescribed below.

  • Drop down control
    • Name: DrpStates
    • Items: [” “,”Florida”,”Texas”,”Massachusetts”]
    • Default: varStateDefault (We will create this variable later)

Now we will add the 4 buttons. The OnSelect event will first reset the drop down to it’s initial state and then we assign the variable “varStateDefault” accordingly in each button.

  • Button
    • Name: btnSetDefaultTexas
    • OnSelect: Reset(DrpStates);UpdateContext({varStateDefault:”Texas”})
  • Button
    • Name: btnSetDefaultFlorida
    • OnSelect: Reset(DrpStates);UpdateContext({varStateDefault:”Florida”})
  • Button
    • Name: btnSetDefaultMassachusetts
    • OnSelect: Reset(DrpStates);UpdateContext({varStateDefault:”Massachusetts”})
  • Button
    • Name: btnSetDefaultBlank
    • OnSelect: Reset(DrpStates);UpdateContext({varStateDefault:” “})

You now know how to set the drop down default value in PowerApps. To enhance this technique further you should write the users choices to a database and when the app opens read the values from the database and assign them to the variable you set as the default. Read my post on how-to-change-the-color-theme-in-powerapps-during-run-time as an additional way to give your users customization choices.

Please leave your feedback. I hope this article has been helpful for you and bookmark this blog and check back often as new articles will be posted regular.

Share the knowledge!

Paul Rodrigues

Business Analyst with 20 years of IT experience creating practical solutions. I love to automate business processes through the use of technology while making the end users work easier. My current favorite tools are Power Apps, Power BI and Power Automate. #PowerAddict

You may also like...