Setting Selected Text in a PA Dropdown

dropdownA common question that I’ve run into again lately is how can I set the Selected or Selected Text property of a dropdown control in a Canvas App when there is NO Selected property?  The key to solving this problem is understanding the interaction between two other aspects in Power Apps.  They are the default property of the Dropdown and the Reset() function in Power Apps.  Lets look at how each of these work and how they interact.

Dropdown Default Property

Setting the initial value in a dropdown is as easy as setting the default property of the control.  When the control first loads it will look at the default property to set the initial value of the controls. The problem is that once a user has interacted with the control the default setting will be ignored. This is where the Reset() function comes in.

Reset() Function

The Reset() function in Power Apps is specifically designed to reset a given control back to their Default settings.  Adding Reset(<<DropDown>>); to the end of an OnSelect that Patches or Submits a form will clear the user’s input and reset the Dropdown back to its original default value.

Try it Yourself

  1. Add a Dropdown and a Button to a Screen in a Power App
  2. Set the Default property of the Dropdown to “2”
  3. Type reset(Dropdown1) into the OnSelect Property of the Button

When you run the app the dropdown will default to 2. Use the dropdown to select 3 as the chosen value. Navigate to a different screen and back again.  The dropdown will be set to 3. Press the button.  The dropdown selected value will change to 2

This functionality works on most controls with minor variations.  Its the same for TextInput boxes, but for ComboBoxes you set DefaultSelectedItems to a record containing the value of the default selection.

Published by

Paul Papanek Stork

I am a SharePoint MVP who has specialized in Microsoft products since the mid-1990s. As a "Jack of all Trades" I have developed expertise as a network administrator, developer, and DBA. I works as a consultant/trainer where my breadth of knowledge makes me ideally suited to combine Administrative, Development, and SharePoint Designer topics. My 20+ years of experience and broad background make me a much sought after resource for SharePoint questions that cross traditional boundaries. I was a contributing author to the Developer's Guide to Windows SharePoint Services v3 Platform and the SharePoint Server 2007 Deployment Best Practices. My most recent book, the MCTS Windows SharePoint Services 3.0 Configuration Study Guide: Exam 70-631, was released in October, 2009.