Skip to main content

Notifications

Community site session details

Community site session details

Session Id : njn+YXOTyag2Mh5txaN8I9
Power Automate - Using Flows
Answered

Delete files in OneDrive older than 60 day`s

Like (0) ShareShare
ReportReport
Posted on 10 May 2019 07:33:29 by 899

I try to make a flow for Delete files in OneDrive older than 60 day`s with this example.

 

But for this point:

  3-1. Action: Data Operations - Compose ( Inputs = "@div(sub(ticks(utcnow()), ticks(item()?['LastModified'])), 864000000000)" )

i can`t put it in the expression box, it gives a error.

 

Is there an other example to make a flow for Delete files in OneDrive older than xx day`s?

  • frixel Profile Picture
    899 on 14 May 2019 at 05:36:19
    Re: Delete files in OneDrive older than 60 day`s

    Hi @v-bacao-msft  @ScottShearer 

     

    If i set that files older than 3 day`s must be beleted is delets file`s from 01-05-2019 -02-05-2019 and 03-05-2019

     

    flow12.pngflow13.png

     

    flow14.png

  • frixel Profile Picture
    899 on 13 May 2019 at 08:58:21
    Re: Delete files in OneDrive older than 60 day`s

    Hi @v-bacao-msft 

    See below. Mail is send but files are not deleted.

     

     

     

     

     

    flow10.pngflow11.png

  • v-bacao-msft Profile Picture
    on 13 May 2019 at 08:22:24
    Re: Delete files in OneDrive older than 60 day`s

    51.PNG

  • frixel Profile Picture
    899 on 13 May 2019 at 08:19:20
    Re: Delete files in OneDrive older than 60 day`s

    flow8.png

  • v-bacao-msft Profile Picture
    on 13 May 2019 at 08:06:49
    Re: Delete files in OneDrive older than 60 day`s

    Hi @frixel ,

     

    You can initialize an array to store information about the filtered files.

    Use Length() function to calculate the number of files, or you could create an HTML table to display file information.

    Image reference:

    49.PNG50.PNG

     

    Please take a try.

     

    Best Regards,

  • frixel Profile Picture
    899 on 13 May 2019 at 07:51:01
    Re: Delete files in OneDrive older than 60 day`s

    Can I ask one more question?

    If I want to receive 1 mail when files have been deleted, how do I set it?

    If I do it like the below, flow sent an email for each deleted file.(it would be even better if flow counts how many files have been deleted.)

     

    flow7.png

     

     

  • frixel Profile Picture
    899 on 13 May 2019 at 06:50:09
    Re: Delete files in OneDrive older than 60 day`s

    Ahh,sorry. I forget to "update" the  addDays(utcNow) expression Man Happy

    Now it works fine.

  • v-bacao-msft Profile Picture
    on 13 May 2019 at 06:43:08
    Re: Delete files in OneDrive older than 60 day`s

    What happened, it should only delete the eligible files according to the conditions you set.

     

     

  • frixel Profile Picture
    899 on 13 May 2019 at 06:38:21
    Re: Delete files in OneDrive older than 60 day`s

    When i do this al the files wil be deleted Smiley Mad

     

    flow5.png

  • Verified answer
    v-bacao-msft Profile Picture
    on 13 May 2019 at 05:59:25
    Re: Delete files in OneDrive older than 60 day`s

    Hi @frixel ,

     

    Please use Compose output Last modified and Is folder.

    45.PNG

    Please show the details of your Flow configuration.

     

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,513 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,606 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow
Loading started