In this Power Apps tutorial, we will discuss how to set default value in Power Apps list box control. Let us understand a few examples of setting up default value in list box in Power Apps.
- Power Apps list box default property
- Power Apps list box control default
- Power Apps list box control default multiple
- Power Apps list box default office 365 Users
- Power Apps list box default person
- Power Apps list box default choices
- Power Apps list box default first item
- Power Apps list box default blank
If you are new to the Power Apps list box control, check out a complete tutorial on how to use Power Apps list box control.
Power Apps list box default property
Before we can work on setting a default value within the Power Apps list box control, we must first understand what the Power Apps list box’s Default property is.
While working with the Power Apps list box control, we can find the Default property under the Properties panel that defines the control’s initial value before it is changed by the user.
By default, the value “1” is set as the default. If we set the default to “2” or “3,” the default value will be displayed as 2 or 3 respectively.
This is how the default property works in the Power Apps list box control.
Also read: Power Apps Listbox items from SharePoint list
Power Apps list box control default
Here, we will see how to set a default value within the Power Apps list box control. Let’s build a list box control using some custom values in the Power Apps screen. Then, we will set a default value from the list of items.
To work with this requirement, the following steps are:
- On the Power Apps screen, add a list box control under the Insert tab > Inputs.
- Insert the below expression having custom values within the Items property of the Power Apps list box control.
Items = ["KIA", "Renault", "Audi", "Lexus", "Mercedes", "BMW"]
- From the above list box control, let’s set “Lexus” as the default value. For this, insert the text value within a pair of double quotes “<Value>” in the list box’s Default property.
Default = "Lexus"
Now, we can see the value will display as the default value within the Power Apps list box control shown below:
This is how to set a default value inside the Power Apps list box control.
Check out: Power Apps combo box default value
Power Apps list box control default multiple
Do you want to set multiple items as the default value in the Power Apps list box control? Unfortunately, no such property in the Power Apps List box control allows us to set multiple values as the default.
But to select Multiple items, there is a property in the list box control named ‘Select Multiple’ that controls whether a user can choose more than one item in the list box.
Power Apps list box default office 365 Users
Here, we will see how to set a default Office 365 User within the Power Apps list box control. That means we will build a Power Apps list box control that will display all the Office 365 Users and on that list box, we will set the current login user as the default value.
Note: To work with the Office 365 Users, we just need to connect the Power apps with the Office 365 Users connector.
To work with the above requirement, the following steps are:
- On the Power Apps screen, add a list box control.
- Insert the below expression on the Items property of the List box control.
Items = Office365Users.SearchUser()
- We want to set the logged-in user as the default value from the above list box. For this, insert the below expression on the list box’s Default property.
Default = User().FullName
Once the above formula is applied, it will automatically show the current user as the default value within the Power Apps list box control.
This is how to set the default office 365 Users inside the Power Apps list box control.
Read: Power Apps Combo box with SharePoint list
Power Apps list box default person
Here, we will see how to set a default person in the Power Apps list box control. That means we will build a list box control using the SharePoint people column and then we will set a person’s name as the default item in the Power Apps screen.
Suppose, we have a SharePoint list having a people column named Name.
For this, the following steps are:
- On the Power Apps screen, add a button control.
- Insert the below expression on the OnSelect property of the PowerApps button control. As a result, when the user clicks on the button, it will create a collection of the people column.
Items = ClearCollect(colPeople,Distinct(Workers,Name)); ForAll(colPeople,Collect(ColWorker,Result));
Where colPeople and ColWorker are the names of the collections.
Let’s click on the Alt key + Button control to create the collection. We can see all the fields have been created in the ColWorker collection (Under colPeople) below:
- Next, add a list box control to the Power Apps screen and insert the collection name (i.e., ColWorker) on the Items property to display the list of people’s names from the specified SharePoint column.
Note: Make sure to set the Value as Display Name on the Power Apps list box control.
- On the above list box control, let’s set the current user as the default item. For this, insert the below expression on the Default property of the Power Apps list box control.
Default = User().FullName
We can see it will distinguish the current user as the default item shown as below:
This is how to set a default person name within the Power Apps list box control.
Check: Power Apps combo box filter
Power Apps list box default choice
Here, we will see how to set a default choice within the Power Apps list box control. That means we will build a Power Apps list box control using a choice field and set a default value inside that list box control. To perform this requirement, we will use the above SharePoint list (i.e., Workers) and the following steps are:
- On the Power Apps screen, add a list box control.
- Insert the below expression on the Items property to display the choices of the Worker’s WorkMode column.
Items = Choices(Workers.WorkMode)
We can see it will display all the choices on the list box control.
- Suppose, we want to make the “WFH” the default choice from the above Power Apps list box control. For this, insert the below expression on the Default property.
Default = "WFH"
We can see, it will display that specified item as the default choice within the Power Apps List box control.
This is how to set a default choice within the Power Apps list box control.
Have a look: How to Patch Power Apps Combo Box
Power Apps list box default first item
Here, we will see how to set the first item as the default within the Power Apps list box control.
Suppose, we have a SharePoint list named ‘IT Sectors’ having columns such as Sector (Single line of text column) and Country (Choice column).
- From the above SharePoint list, we will build a list box control using the Sector column. For this, add a list box control to the Power Apps screen and insert the below expression on the Items property.
Items = Distinct('IT Sectors',Sector)
To avoid duplicate items, we have used the Distinct().
- Let’s set the first item as the default within the Power Apps list box control. To do this, inject the below expression on the list box’s Default property.
Default = First('IT Sectors').Sector
Once the formula is applied, we can see it will determine the first item as the default shown below:
This is how to set the first item as the default within the Power Apps list box control.
Check out: How to Sort Combo Box Items in Power Apps
Power Apps list box default blank
Here, we will see how to set a default blank value within the Power Apps list box control. That means we will build a list box control having a blank value and that will display the blank value as the default within the Power Apps.
We are going to use the above SharePoint list named ‘IT Sectors’ and the following steps are:
- Add a button control to the Power Apps screen.
- Insert the below expression into the button’s OnSelect property. As a result, when the user clicks on the button it will create the collection.
OnSelect = ClearCollect(ColSector,{Result:" "});Collect(ColSector,Distinct('IT Sectors',Sector))
Where,
- ColSector: The name of the collection.
- Result: The header name of the collection to store the items.
- ‘IT Sector’: The name of the SharePoint list.
- Sector: The name of the SharePoint column.
- Let’s click on the Alt key + Button control to create the collection with a blank value.
- Using the above collection, we will build a list box control within the Power Apps screen. Add a list box control and insert the collection name (i.e., ColSector) in the Items property.
- On the above list box control, we can see a blank value has been created. Now, we will make this blank value as the default. For this, insert the below expression on the Default property of the Power Apps list box control.
Default = " "
Once we insert the above expression, we can see it will show the blank value as the default, as below:
This is how to set the blank value as the default within the Power Apps list box control.
Furthermore, you may like some more Power Apps tutorials:
- How to Patch Power Apps Date Picker
- Power Apps Checkbox control within Gallery
- How to Reset Power Apps Date Picker
- Power Apps combo box with Office 365 users
- How to Reset Power Apps Combo Box
- How to use Power Apps Combo Box Control?
- Power Apps Cascading Dropdown Control
- How to Filter Power Apps Dropdown Control
Conclusion
From this Power Apps Tutorial, we learned how to set a default value within a Power Apps list box control based on different types of criteria. such as:
- Power Apps list box default property
- Power Apps list box control default
- Power Apps list box control default multiple
- Power Apps list box default office 365 Users
- Power Apps list box default person
- Power Apps list box default choices
- Power Apps list box default first item
- Power Apps list box default blank
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Out audiences are from the United States, Canada, United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a SharePoint MVP(8 times), check out My MVP Profile. I have also worked in companies like HP, TCS, KPIT, etc.