How To Set Default Value in Power Apps List Box Control

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.

Power Apps list box default property
Power Apps list box default property

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.

Power Apps listbox default property
Power Apps Listbox default property

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"]
Power Apps listbox control default
Power Apps Listbox control default
  • 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:

PowerApps list box control default
PowerApps list box control default

This is how to set a default value inside the Power Apps list box control.

See also  Power Apps SharePoint Button

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.

Power Apps list box default office 365 Users
Power Apps list box default office 365 Users

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()
PowerApps list box default office 365 Users
PowerApps list box default office 365 Users
  • 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.

Power Apps listbox default office 365 Users
Power Apps Listbox default office 365 Users

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.

Power Apps list box default person
Power Apps list box default person

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.

Power Apps list box default person field
Power Apps list box default person field

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:

Power Apps list box set default person
Power Apps list box set default person
  • 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.
Power Apps list box default set person
Power Apps list box default set person

Note: Make sure to set the Value as Display Name on the Power Apps list box control.

Power Apps list box set a default person
Power Apps list box sets a default person
  • 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:

PowerApps list box default person
PowerApps list box default person

This is how to set a default person name within the Power Apps list box control.

See also  How to Convert a String to a Decimal Number in Power Automate?

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.

Power Apps list box default choices
Power Apps list box default choice
  • 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.

PowerApps list box default choice
PowerApps list box default choice

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).

Power Apps list box default first item
Power Apps list box default first item
  • 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().

PowerApps list box default first item
PowerApps list box default first item
  • 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:

Power Apps list box default first item
Power Apps list box default first item

This is how to set the first item as the default within the Power Apps list box control.

See also  Power bi slicer filter another slicer - How to do

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,

  1. ColSector: The name of the collection.
  2. Result: The header name of the collection to store the items.
  3. ‘IT Sector’: The name of the SharePoint list.
  4. Sector: The name of the SharePoint column.
Power Apps list box default blank
Power Apps list box default blank
  • Let’s click on the Alt key + Button control to create the collection with a blank value.
Power Apps list box set default blank
Power Apps list box set default blank
  • 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.
Power Apps list box set default as blank value
Power Apps list box set default as blank value
  • 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:

PowerApps list box default blank
PowerApps list box default blank

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:

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
>