How to Sort Power Apps Combo Box Items [6 Various Ways]

I recently created a Power Apps form with a combo box control containing country names as items. To reduce the search time, I sorted the combo box items alphabetically. Users can scroll through the combo box items based on the first letter and easily select their country name.

In this article, I will explain the 6 various ways to sort Power Apps Combo box items.

Sort Power Apps Combo Box Items From the Collection

Let’s see how to sort the items in the combo box control where the items are added from the Power Apps collection.

The Power Apps combo box items are sorted in ascending order in the example below.

power apps combo box items sort

Follow the steps below to achieve this!

1. To create a Power Apps collection, provide the code below in the OnStart property of the App object.

ClearCollect(
    colCountryNames,
    {Countryname: "Brazil"},
    {Countryname: "Myanmar"},
    {Countryname: "Bolivia"},
    {Countryname: "Sri Lanka"},
    {Countryname: "Indonesia"},
    {Countryname: "Malaysia"},
    {Countryname: "Philippines"},
    {Countryname: "Canada"},
    {Countryname: "Algeria"},
    {Countryname: "India"}
)
sort power apps combo box items

2. Add a Combo box control from the +Insert tab in Power Apps and provide the below formula in its Items property.

Sort(colCountryNames.Countryname,Countryname,SortOrder.Ascending)

The Sort() function sorts the collection items in the Power Apps combo box control in ascending order.

  • colCountryNames is the collection name
  • Countryname is the collection column header name.
sort power apps combobox items in ascending order

Now, save and preview the app. The Power Apps combo box collection items are displayed in ascending order.

This way, we can sort the items in the Power Apps combo box control if it takes values from the collection.

Sort Power Apps Combo box items From the SharePoint List

Here, we’ll see how to sort the combo box items where items are taken from the SharePoint list. The example below shows that the SharePoint list items in the Power Apps combo box are sorted in descending order.

sort power apps combo box items in descending order

The Power Apps combo box values are taken from the SharePoint list named Project Details List below.

power apps combobox sort distinct

Follow the steps below to achieve this!

1. Connect the SharePoint list with Power Apps. Then, add a combo box control from the +Insert tab.

how to sort power apps combo box items

2. Provide the formula below in the Items property of the Power Apps combo box control to display the project names.

Distinct('Project Details List',Title)

Power Apps Distinct function will remove the duplicate values and return unique values to the Power Apps combo box control.

how to sort combo box items in power apps

Then, it will display the project names in a combo box, similar to how we stored them in the SharePoint list.

power apps sort combo box from sharepoint list

3. To sort the project names in the Power Apps combo box control, provide the formula below for its Items property.

Sort(Distinct('Project Details List',Title),Value,SortOrder.Descending)

Here, the sort function will sort the items in the Power Apps combo box in descending order.

power apps combo box items sort in reverse order

4. Save the changes and preview the app once. The Power Apps combo box control items are sorted in descending order.

I hope you understand how to sort the Power Apps combo box items where items are taken from the SharePoint list.

Power Apps Sort Combo Box Choice Field

Let’s see how to sort the Power Apps combo box control values. Where the combo box items are taken from the SharePoint list choice field.

The image below shows that the Power Apps combo box items are sorted in ascending order.

Power Apps Combo box sort distinct

Here is the SharePoint list named Expense Report Form and the choice column [Expense Category].

power apps sort combo box from sharepoint choice column

To do this, follow the steps below!

1. Connect the SharePoint list with Power Apps. Add a Combo box control and provide the formula below in its Items property to get the SharePoint list choice field values.

Choices([@'Expense Report Form'].'Expense Category')

Change the Expense Report Form with the SharePoint list name and Expense Category with your choice column name.

power apps sort combobox choices from sharepoint list

2. Save changes and preview the app once. The Power Apps combo box control will display the choice field values.

power apps sort combobox from share point list choice field

3. To sort the Power Apps combo box values, provide the formula below in its Items property.

Sort(Choices([@'Expense Report Form'].'Expense Category')
,Value,SortOrder.Ascending)

The sort function will sort the SharePoint list choice values in the Power Apps combo box in ascending order.

how to sort choice column values in power apps combo box

4. Now, save and preview the app. The items in the combo box control were sorted in ascending order.

Power Apps Sort Combo Box Date Field

We have seen how to sort the SharePoint list choice and title fields in the Power Apps combo box control. Let’s see how to get the SharePoint list date field in the Power Apps combo box and then how to sort the date values.

how to sort date values in power apps combo box

Here is the SharePoint list named Expense Report Form with Date field.

sort dates in power apps combo box

To do this, follow the steps below!

1. In Power Apps, connect with the SharePoint list from the Data section. Then, add a combo box control.

how to sort power apps combo box items

2. Provide the formula below in the Items property of the Power Apps combo box control to get the date values.

Distinct('Expense Report Form',Date)
sort power apps combo box date field

3. To format the date field values and to sort the dates in the Power Apps combo box, provide the formula below in the Items property.

Distinct(Sort('Expense Report Form'.Date,Date),Text(Date,"[$-en-US]dd/mm/yyyy"))

The Text function changes the date format to dd/mm/yyyy. The sort function sorts the date values in the combo box in ascending order.

how to sort power apps combo box date values from sharepoint list

Now, save and preview the app once you can see the dates in the Power Apps combo box are sorted in ascending order.

Sort Power Apps Combo Box Alphabetically

Here, I will explain how to alphabetically sort the Power Apps combo box. I have a SharePoint list named Teams Details.

sort power apps combo box items alphabetically

The Power Apps combo box control below displays the Team Name field from the above SharePoint list in alphabetical order.

power apps sort combo box alphabetically

To achieve this, follow the steps below!

1. In Power Apps, connect with the SharePoint list from the Data section. Then, add a combo box control.

how to sort power apps combo box items

2. Provide the formula below in the Items property of the combo box. To get the SharePoint list team name field values and sort them alphabetically

Sort(Distinct('Teams List',Title),Value)

This sort function, by default, sorts the combo box values alphabetically if we don’t provide any sort order.

power apps sort combobox alphabetically

Save the changes and preview the app once. The Power Apps combo box control team names will be sorted alphabetically.

Power Apps Sort Combo Box Search Microsoft 365 Users

I have a combo box control in Power Apps containing the Microsoft 365 users. To track all the users, I sorted them in ascending order, as in the example below.

power apps sort combo box items office 365 users

To achieve this, follow the steps below!

1. Connect Power Apps with Office365Users connector from the Data section.

power apps sort combo box search office 365 users

2. To sort and get the Microsoft 365 users, provide the below formula in the Items property of the Power Apps combo box control.

Sort(Office365Users.SearchUser({searchTerm:'cmb_offcie 365'.SearchText}).DisplayName,DisplayName,SortOrder.Ascending)

Here, cmb_offcie 365 is the name of the combo box control. Office365Users.SearchUser will allow us to search for Microsoft 365 users in the Power Apps combo box control.

power apps sort combo box values of 365 users

Save and Publish the app. The Microsoft 365 users will be displayed in ascending order.

This way, we can sort the Microsoft 365 users present in the Power Apps combo box control.

I hope you found this helpful article! I have explained various examples of sorting Power Apps combo box control in both orders.

Follow this article if you’re trying to sort the Power Apps combo box items.

Also, you may like:

>