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

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

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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (1,649)