cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 II
Dual Super User II

Hi @Anonymous 

 

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 II
Dual Super User II

Hi @Anonymous 

 

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

Anonymous
Not applicable

Thank you so much Reza!

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (15,271)