Skip to main content

Notifications

Community site session details
Power Apps - Building Power Apps
Answered

Ordering Files in Sharepoint by date modified/created

Like (1) ShareShare
ReportReport
Posted on 12 Mar 2025 13:15:02 by 6
Hi,
 
For the life of me I cannot get automate to list files in a folder by date modified. I'm trying to get the newest file in a specific folder. here's what I have: It runs perfectly when I just use the get files (properties only) but not when I add in the OrderBy Modified. I've checked that that is the right thing to reference and it is, I've also tried using ChatGPT, but it runs me round in circles. Is there something really obvious I should be doing? For some reason, it also adds in an Apply to Each loop by itself. Help Appreciated. 
 
Categories:
  • Verified answer
    Solutionm8 Profile Picture
    92 on 12 Mar 2025 at 16:50:21
    Ordering Files in Sharepoint by date modified/created
    Hi

    The reason that it inserts an apply to each is because you are selecting a dynamic value from a previous action that might return more than one item.
    Just remove it and insert a new Get files (properties only) action and follow the steps below.

    The value in the Order By field needs to be specified as an ODATA OrderBy query.
    So the column name in plain text and then followed by the sort direction - either asc or desc. So "Modified asc" or "Modified desc."
    See the picture below.



    Please click Does this answer your question 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 a Like.
    Visit my YouTube channel: Solutionm8
     

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 98 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 73

#3
stampcoin Profile Picture

stampcoin 50

Overall leaderboard
Loading started
Loading started