web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Advanced sort by date
Power Apps
Answered

Advanced sort by date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

I am trying to apply sorting to my items in the gallery. Here is the formula in my sort ↑↓ button:

UpdateContext({varSort: !varSort})

and here in my item gallery:

SortByColumns(Filter(Ticket, User().Email = Requestor.Email , "Modified",If(varSort = true, Descending))

by default the item will be sort using modified date.

So now, I wanted to add the option for the user to sort between Modified and Created date when sorting. I have added two buttons as such: 

Set(toggleModified, false);Set(toggleCreated, true)

 
But I can't seem to work and combine the formulas or are there any easier workaround to do this? Thank you in advanced!

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,064 Most Valuable Professional on at

    Hi @Anonymous ,

    If you only have two sort options, you only need one toggle

    Sort(
     Filter(
     Ticket,
     Requestor.Email=User().Email
     ), 
     If(
     ToggleModified,
     Modified 
     Created,
     ),
     If(
     varSort, 
     Descending,
     Ascending
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,
    Thank you so much it works well and simple enough!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 337 Most Valuable Professional

#2
11manish Profile Picture

11manish 173

#3
Valantis Profile Picture

Valantis 86

Last 30 days Overall leaderboard