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 / Sort Items based on Date
Power Apps
Answered

Sort Items based on Date

(0) ShareShare
ReportReport
Posted on by 825

Hi 

Experts im trying to sort the items based on name if entered and when they select the sortDecending1 button the items should sort based in the recent date order.  i.e from new to old and when deselected the sort button gallery items so be normal as old to new.

 

I do not know if im doing it correctly or not the below code is correct or not. Can anyone help me, please? if m doing wrong and what part im doing ...

 

Thanks, experts

ON Items property of Gallery:   also with the below formula im getting the delegation warning

 

Tapesh_0-1599644372555.png

When I used the above formula or code 

 

Im getting an error. as below  

Tapesh_0-1599645109881.png

 

 
 

 

 

Please see: I have converted date time to different formate using 

ON text property :

 

 

Text(ThisItem.Created, "[$-en-US]d, mmmm yyyy")

 

 

 

Whereas initial it was just simple Datetime Formate 

Tapesh_0-1599481013416.png

However, the error does remain the same. I.e. unable to sort items on date order ascending or descending.

 

 

Any help Experts Thanks. 

Has to raise this query again as I did not get any feedback on my last one. 

Thanks in advance.

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Tapesh 

    I'm not completely sure of your formula as you mention sorting by date, but it appears to be sorting by title.

    If you want to sort by the Created date, then you can consider using this formula:

    SortByColumns(
     Filter(
     'Petty Cash & GL Code' ,
     (StatusResult = "All" || Status = StatusResult) &&
     (SearchBox.Text = "" || StartsWith('Name (Title)', SearchBox.Text))
     ),
     "Created",
     If(SortDescending1, Descending, Ascending)
    ) 

     

    This should give you results sorted by Created date.

     

    Also, for future reference, if you want to sort by the Text version of a date, you should have your date in a yyyymmdd format.  Otherwise your sorting will be incorrect.

     

    I hope this is helpful for you.

     

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard