Skip to main content

Notifications

Community site session details

Community site session details

Session Id : z9pXwEGUkNq7HkQmdEyEVb
Power Apps - Building Power Apps
Answered

How can I sort this combo box alphabetically?

Like (0) ShareShare
ReportReport
Posted on 2 Mar 2023 09:22:15 by 28

Hi,

 

I have two combo boxes that allow you to select company or department that link up to a gallery. The combo boxes use this function:

 

 

Distinct(
 Office365Users.SearchUser({searchTerm: ""}).CompanyName,
 CompanyName
)

 

 

It shows all the companies but not in alphabetical order. They seem to be in the order that they appear in the gallery. Is it possible to change the order to alphabetical?

 

Thanks.

  • Verified answer
    AlexJD Profile Picture
    28 on 02 Mar 2023 at 10:22:28
    Re: How can I sort this combo box alphabetically?

    So close but didn't work. Switch out "Sort" for "SortByColumns" and it worked:

     

    SortByColumns(
     Distinct(
     Office365Users.SearchUser({searchTerm: ""}).Department,
     Department
     ),
     "Result"
    )
  • timl Profile Picture
    35,109 Super User 2025 Season 1 on 02 Mar 2023 at 09:36:21
    Re: How can I sort this combo box alphabetically?

    Hi @AlexJD 

    This will sort the results:

     

    Sort(
     Distinct(
     Office365Users.SearchUser({searchTerm: ""}).CompanyName,
     CompanyName
     ),
     Result
    )

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 298 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 169

#3
stampcoin Profile Picture

stampcoin 130

Overall leaderboard
Loading started