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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Formula for Deletion o...
Power Automate
Unanswered

Formula for Deletion of old files from sharepoint in a specific time period

(0) ShareShare
ReportReport
Posted on by
Hi All
 
I am attempting to setup an auto delete function for old files on a SharePoint however the formula is not working addDays(utcNow(), -100)
 
When testing the flow, the test is failing
 
Please can someone assist who has experienced with this
 
 
Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,502 Super User 2025 Season 2 on at
    @MR-17020915-0 It's hard to offer any recommendations without seeing your full flow and what action is failing. Toggle off the New Designer and click each action to expand it. Upload a screenshot of your flow in edit mode.
     
    In the meantime, if you are using the Get Files (properties only) action—the name can be misleading as it returns files AND folders. You'll need to use a Filter Query to filter out files only. Refer to this YT Short. Additionally, if you have more than 100 files/folders in your selected document library you will need to ensure you toggle on pagination. By default the Get Files (properties only) action will only return 100 files and folders. 
     
    You might also be interested in this YT Tutorial:

    Are you easily stumped when working with Dates in Power Automate? In this Power Automate tutorial, I’ll show you how to compose an expression that will return a future date, a past date, how to count the number of days between two dates, how to check for a birthdate and anniversary date as well as tips and tricks when working with dates in Power Automate. I’ll cover some common use cases and concepts that can help you to build better Power Automate flows.

    Feel free to skip ahead using the timestamps listed below. I’ve also linked a few other tutorials that you might be interested in as well.

    IN THIS VIDEO:
    ✓ 4 Date Functions You Need to Know
    ✓ How to use the Convert Time Zone Action
    ✓ How to Get a Future Date
    ✓ How to Get a Past Date
    ✓ How to Return SharePoint Items Due in a Number of Days
    ✓ How to Return SharePoint Items Due within a Date Range
    ✓ How to write a Filter Query for SharePoint Items Due in 30, 60 and 90 Days
    ✓ How to Calculate the Number of Days between Two Dates
    ✓ How to Check for a Birthdate and Anniversary Date
    ✓ How to work with Dates and Times in Excel
    ✓ How to use a Manual Trigger with Date Input
    ✓ How to Output Dynamic Text with an Expression
    ✓ How to Check if a Date Falls on a Weekend
     

     
    Hope this helps!

    Consider giving me a ❤️ if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    It is best if you show your flow, otherwise one can only guess what you are doing. With that said, I assume you're using a get files action with a filter query, and the expression above is used in the filter. If so, is that all you have in the filter query? If so, that is one reason it does not work. You need to specify the field to filter on and the condition (gt, lt, ge, le). Also, query filters on dates must be formatted in ISO8601 format (yyyy-MM-dd).

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard