cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hxiaSMMA
Level: Powered On

Order the Office365Users list

Hi I am building a powerapps for our company and I am having trouble using "Ascending" and "Descending"

Right now, I have this code that searches the users by department. It works but the employees are all over the places.
I would like to have them organized by last name. So for example, AAA. Brian should be first and AB, Ryan should be the second to appear.

 

How do I do this?

 

Thank you

If(Dropdown4.SelectedText.Value <> "All",
Filter(
    Office365Users.SearchUser(
        {
            searchTerm: "",
            top: 500
        }
    ),
    Department = Dropdown4.Selected.Value
),
Filter(
Office365Users.SearchUser(
        {
            searchTerm: "",
            top: 500
        }
    ), 
    Department <> Blank()
))
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Order the Office365Users list

Hi @hxiaSMMA 

 

SortByColumns(Filter(
Office365Users.SearchUser(
{
searchTerm: "",
top: 500
}
),
Department <> Blank()
),"GivenName","Surname")

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Order the Office365Users list

Hi @hxiaSMMA 

 

SortByColumns(Filter(
Office365Users.SearchUser(
{
searchTerm: "",
top: 500
}
),
Department <> Blank()
),"GivenName","Surname")

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

hxiaSMMA
Level: Powered On

Re: Order the Office365Users list

Thank you so much Reza!

Btw, do you know how to add two different data sources to one "Gallery"?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 218 members 5,234 guests
Please welcome our newest community members: