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 / How delete many files ...
Power Automate
Unanswered

How delete many files from OneDrive older than 30 days

(0) ShareShare
ReportReport
Posted on by 969

Hi,

 

I want to make a flow for delete many files from OneDrive older than 30 days.

I have make this but no files will deleted.

 

flow1.png

Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    Hi @frixel , I've noticed in my tests that the "List files in a folder" OneDrive action only gets the first 20 items. I don't know why it does that but it might go some way to explain why the flow isn't working as expected.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • frixel Profile Picture
    969 on at

    hi @RobElliott 

     

    Where can i find that 'test" from you so i can dublicate that for testing by myself.

    Now i try so many times to make a Flow for delete files in my OneDrive but it is always a mistake.

  • Verified answer
    v-bacao-msft Profile Picture
    on at

    Hi @frixel ,

     

    Could you provide the details of the error message?

    You could refer to the configuration below to create a Flow.

    34.PNG

    Expression reference:

    formatDateTime(body('Get_file_metadata')?['LastModified'],'yyyy-MM-dd')
    addDays(utcNow(),-30,'yyyy-MM-dd')

    In addition, List files in folder action only returns 20 items. Currently there is such a restriction. If you want to increase the limit on the number of files returned, please consider voting for similar ideas:

    List-files-in-folder-on-OneDrive-without-limit

     

    Best Regards,

  • frixel Profile Picture
    969 on at

    hi @v-bacao-msft 

     

    Also this flow don`t delete any file in the folder.

    There are files from 04-06-2019 till today in that folder but the flow gives in the output van compose 01-07-2019.

    I see that come back every time I try to create a flow to clean up files.

     

    flow1.png

  • v-bacao-msft Profile Picture
    on at

    Hi @frixel ,

     

    Note that only Last Modified Time can be obtained here.

    If you are configuring Flow according to my method, the result is as expected, and compose is used to enter the last modified Time of the current file.

    If the date is 2019-07-01, the result of the Condition judgment is false.

     

    Best Regards,

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard