cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichaelBL
Helper II
Helper II

Sort gallery

Hi all,

 

I have a gallery that I am already filtering like this below, to ensure that items are filtered based on logged in user.

 

Filter([datasource], 'Creator Email' = VarUser.Email)

 

That first part works fine.

 

I do however also need to sort these items and I tried this:

Filter([datasource], 'Creator Email' = VarUser.Email); Sort([datasource], Created, Descending)

 

Only thing is that it is not working.

 

Any ideas on what I am doing wrong?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
MichaelBL
Helper II
Helper II

Thank you for replying..

 

I was able to figure it out on my own!

This worked for me:

SortByColumns(Filter([Datasource], 'Creator Email' = VarUser.Email), "Created", Descending)

View solution in original post

3 REPLIES 3
eka24
Super User
Super User

Try this:

Sort(Filter([datasource], 'Creator Email' = VarUser.Email), Created, Descending)
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Scoozi
Helper I
Helper I

I wanted to offer another solution.

 

SortByColumns(Filter(list,VarUser.Email in Col1 || VarUser.Other in Col2), "Col1", If(SortAscend,Ascending,Descending))

 

SortAscend is a context variable that is initialized to true in the on visible screen property. you can then create a button that when clicked that toggles the context variable like "UpdateContext({SortAscend: !SortAscend})". This should do what you want as well.

MichaelBL
Helper II
Helper II

Thank you for replying..

 

I was able to figure it out on my own!

This worked for me:

SortByColumns(Filter([Datasource], 'Creator Email' = VarUser.Email), "Created", Descending)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,422)