Reset The Drop Down on Screen in Power Apps
Follow the below steps to learn how to reset, or unselect, a drop down control when the screen refreshes in Microsoft Power Apps. If this property is not set, when the app user navigates back to that screen the selected item will remain selected, and this could be confusing for the user. It works for drop down controls that hold a simple list or a data source.
As mentioned above, the natural behavior of a drop down control is to maintain its selection. If you navigate away from that screen and come back, your last selection is still visible. In many cases, this may not be an issue, but for one project, I needed the drop down control to refresh each time the screen was visible (loaded) to the app user.
Default behavior for screen is to select the top item which is “Start With This Entity…”
Displaying some of the items in the drop down control list.
Selecting Business and then clicking the Go button will take the app user to a different screen.
Navigating back to the Main screen would still show Business selected in the list. I do not want that.
With your Canvas App open, click Insert, and then choose your desired Screen layout.
Insert Drop Down
Select somewhere on the new Screen, and click Insert, and then choose Drop down for Input.
With the new Drop down control selected, ensure Items is selected in the properties list, and enter your list of items in the formula bar area.
Here is the code I used:
“Start With This Entity…”,
Screen On Visible – Drop Down Reset
In the left navigation, click the Screen that holds the Drop down control. Select the On Visible property and enter Reset function in the formula bar. Ensure to name the Drop down control correctly.
Formula I used: Reset(ddlMain)
It would be easy to make the mistake of thinking that Refresh would perform the same action, but it does not. Refresh is for data sources, and that only refreshes the list; it does not reset the Drop down control to its default value.
Go ahead and save and then run the Canvas App. Now when you select an item from the list, navigate away from that screen and come back, the default item will be selected.
If you have questions about using Microsoft Power Apps, please contact us.
Subscribe to receive our monthly newsletters with the latest updates all in one place! Get important product information, event recaps, blog articles, and more.