In our previous blog, we saw how to create a cascading dropdown in PowerApps using the SharePoint custom list as data source. Today we will see how to set the default value as null or blank for drop-down in PowerApps. We will use the same “States” SharePoint custom list in order to demonstrate this. We have used the “ClearCollect” and “Collect” PowerApps formula to set the default value as null or blank for the drop-down list. For more details on PowerApps formulae, please refer link.

Create PowerApps Screen

In the below screen as you can see that I have created a PowerApps screen with two cascading dropdown list State and District. If you don’t know how to do the cascading please read my previous blog.

Figure 1

Setting a Default value for “State” dropdown list

In order to set the default value of State dropdown list we will use “ClearCollect(collection1,{Name:""}); Collect(collection1,Distinct(States,Title))” formula on “OnSelect ” action of “StateDropdown”. Select behavior will run when we are clicking or selecting the dropdown list. As from the above formulae, we can see that on select of state dropdown first ClearCollect will run followed by the Collect.

Under the Data section the Items for the State dropdown list will be “collection1” which was created using Collect formula. For better understanding please refer below screenshot.

Figure 2

After implementing the formula the State dropdown will look like below.

Set default value as null

Figure 3

Setting a Default value for “District” dropdown list

In order to set the default value of District dropdown list we will use “ClearCollect(collection2,{Name:""});Collect(collection2,(Filter(States,Title=StateDropdown.Selected.Result).District))” formula on “OnSelect ” action of “DsitrictDropdown”. We will use “collection2” to populate the items for District dropdown. Please refer below screenshot for the same.

Set default value as null

Figure 4

Once we are done with the formula than District dropdown will look like below.

Set default value as null

Figure 5

If there are any other ways to set the default values of the dropdown, please let us know by replying. Thanks for visiting my blog. Please share and subscribe to our site for more stuff on PowerApps. In our next blog, we will see how to create a PowerApps form for the SharePoint list.

Reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/formula-reference

https://powerusers.microsoft.com/t5/General-Discussion/Need-Dropdown-with-blank-null-default/td-p/58172