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 by recent/descend...
Power Apps
Answered

Sort by recent/descending date from Sharepoint List

(0) ShareShare
ReportReport
Posted on by 7

Hello!

I want to sort my records by the most recent date in my Sharepoint list from a column called "created". Which is a date and time field. The sort works, but for some reason, it does not put the most recent date first? It appears to stop at 2020 and there are records through 2021 and some into 2022. I'm not sure what I'm missing. 

 

I have this : 
PowerAppCodeSort.jpg

SortByColumns(AddColumns('Employee Recognition', "UserPhoto", If(!IsBlank('Nominee''s Name'.Email) And Office365Users.UserPhotoMetadata('Nominee''s Name'.Email).HasPhoto, Office365Users.UserPhotoV2('Nominee''s Email')), "Initials", With({varRecordUser: If(!IsBlank('Nominee''s Name'.Email), Office365Users.UserProfileV2('Nominee''s Name'.Email))}, Concatenate(Left(varRecordUser.givenName, 1), Left(varRecordUser.surname, 1)))),"Created", Descending)

 

And this is the output only showing 2020 records:

PowerAppResult.jpg

 

Hoping it's a simple fix, but I cant seem to figure it out. Please help! 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @calau1111 

    Always attempt to do functions in order of need.  In your case, the need to sort starts at the Employee Recognition level, so, perform the sort there.

    Please consider changing your Formula to the following:

    AddColumns(
     SortByColumns('Employee Recognition', 
     "Created", Descending
     ),
     "UserPhoto", If(!IsBlank('Nominee''s Name'.Email) And Office365Users.UserPhotoMetadata('Nominee''s Name'.Email).HasPhoto, Office365Users.UserPhotoV2('Nominee''s Email')), 
     "Initials", With({varRecordUser: If(!IsBlank('Nominee''s Name'.Email), Office365Users.UserProfileV2('Nominee''s Name'.Email))}, Left(varRecordUser.givenName, 1) & Left(varRecordUser.surname, 1))
    )

     

    I hope this is helpful for you.

  • calau1111 Profile Picture
    7 on at

    Brilliant! thank 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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard