Introduction
There is no direct option to set up a blank or null value to power apps dropdown list. Instead of using a dropdown, alternatively, we can use a combo box.
Here, we are going to see how to set up a default value as null or blank to power apps dropdown control.
I have two SharePoint lists; the Test list and master list. I am planning to pull the state and district column details from the master list.
In the below screen, I have used power apps form control data source as my test list, and it has two columns: state and district (both are dropdown controls).
Setting a Default value for State dropdown
In order to set a default value as blank to Stare dropdown. We will use the below code in On Select property of State dropdown.
“ClearCollect(Collection1,{Name:""});Collect(Collection1,Distinct(MasterList,State))”
On Select behavior is when we click or select the dropdown list. As in the above formula, we can see that on select of state dropdown and ClearCollect will run first, followed by the Collect.
Under the Data section, the Items for the State dropdown list should be “collection1” which was created using Collect formula. Please refer to the screenshot.
After implementing the above formula, the state dropdown looks like shown below:
Next, we set the default value to district dropdown
To set the default value to district dropdown, we will use the below formula in on the select property of the district dropdown field.
“ClearCollect(Collection2,{Name:""});Collect(Collection2,(Filter(MasterList,State=Dropdown1.Selected.Result).District));”
Please refer to the below screenshot:
Once done, the district dropdown looks like below:
If there are any other ways we can easily set up default values of a dropdown, please let me know by replying.