Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Auto archive files that have not been accessed in sharepoint for 6 months

(0) ShareShare
ReportReport
Posted on by

I have tried doing an auto archive flow for my SharePoint online sites for a couple weeks now. It started with the tutorial at the following URL: https://powerusers.microsoft.com/t5/Webinars-and-Video-Gallery/Microsoft-Flow-Tutorial-Auto-Archive-SharePoint-Files-6-Months/td-p/153930

 

This tutorial is too fast and leaves a lot of questions unanswered, but still i was able to follow it. Ultimately there's a bunch of errors, I had another post where I tried to get help on the errors and the suggestions drifted further and further from something that worked. 

So I thought I'd start over. 

 

Does anyone know how to make a flow that auto-archives stuff by copying files that have not been accessed for 6 months from one folder to another. Namely, from any active synced library to the archive library I've created. 

 

I have seen other posts where people have followed this video and gotten errors. 

 

Any ideas on how to approach this from scratch? 

  • Community Power Platform Member Profile Picture
    on at
    Re: Auto archive files that have not been accessed in sharepoint for 6 months

    It works! Thank you. 

    Wheres the best place in the flow to make a delete file option? 

     

    So after it autoarchives, it deletes the file from the original location.

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Auto archive files that have not been accessed in sharepoint for 6 months

     

    Hi @Anonymous ,

     

    It should be "le" instead of "ie".

     

    When configuring Folder in the Copy file action, click File browse to select the folder instead of entering the folder path manually.

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    on at
    Re: Auto archive files that have not been accessed in sharepoint for 6 months

    Disregard that last one, I changed the expression and removed the 'yyyy-MM-dd' part and it worked. 

     

    But now it says the it cant verify the existence of the directory im trying to copy to: 

     

    {
    "status": 400,
    "message": "Failed to verify the existence of destination location at 'https://tenant.sharepoint.com/sites/ITsub1/archive/' due to error 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)'.\r\nclientRequestId: a3153d92-57d3-4362-9de3-3d49227d184f\r\nserviceRequestId: a3153d92-57d3-4362-9de3-3d49227d184f"
    }
     
    Which is where I was before. Its like it doesn't see a directory that im looking at in sharepoint. 
  • Community Power Platform Member Profile Picture
    on at
    Re: Auto archive files that have not been accessed in sharepoint for 6 months

    V-bacao-msft,

    I ran a test just using 30 days as the date, because the test directory was last modified about 45 days ago.

    I got this error from the expression you suggested: 

     

    The expression " Modified ie '2019-11-17" is not valid.
    clientRequestId: de706d7a-413f-4fbd-971d-c75eb17c0050
    serviceRequestId: de706d7a-413f-4fbd-971d-c75eb17c00

     

    seems to be a viable option otherwise, and simpler than what I was attempting. 

     

  • v-bacao-msft Profile Picture
    on at
    Re: Auto archive files that have not been accessed in sharepoint for 6 months

     

    Hi @Anonymous ,

     

    Have you tried this configuration? You can remove the Get file metadata action, it will not affect the final result of Flow execution.

    182.PNG

     

    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1