cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Dual Super User

Re: Order the Office365Users list

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

Re: Order the Office365Users list

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

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 Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,306)