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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Move Files

(0) ShareShare
ReportReport
Posted on by 6

Hello I am trying to create a flow that moves files depending on their creation date (greater than a month for example) In advance, I really appreciate your attention and support.

Categories:
  • eric-cheng Profile Picture
    5,171 on at

    Hi @Abalderas ,

     

    Will the files be in SharePoint or OneDrive?

     

    I am asking as I don't think you can get Created Date in OneDrive.  

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

  • Abalderas Profile Picture
    6 on at

    Hi @eric-cheng 

     

    They are files that are in SharePoint, which depending on the date they were uploaded I need to transfer them to a folder in OneDrive

     

    That is, I have images that were uploaded to SharePoint in June, July and August and I want everything that is before the current month (August) to be moved to the OneDrive site (not only copied I want to delete what is moved in SharePoint

     

    I really appreciate your support

  • Verified answer
    eric-cheng Profile Picture
    5,171 on at

    Hi @Abalderas ,

     

    Give this flow a go.

     

    1) Use a subtract from time to get the date for last month 

     

    ericcheng_0-1628563948087.png

     

    2) Use a Get Files (properties only) action and specify the following filter query.  The right condition needs to be an expression.

     

    Created lt 'startOfMonth(body('Subtract_from_time'))'

     

    ericcheng_1-1628563994533.png

     

    The rest of the flow looks like the below

     

    ericcheng_2-1628564190993.png

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

     

     

     

     

  • Abalderas Profile Picture
    6 on at

    Hi @eric-cheng 

     

    I am testing your solution and I have managed to move all the files in a path, but I cannot do the test to move the ones that are older than a month

     

    For example I have this folder with three files, how can I delete the file that was created yesterday and leave the two from today?

     

    Abalderas_0-1628622667087.png

    Again, thank you very much for your support, your information is helping me a lot

     

     

  • eric-cheng Profile Picture
    5,171 on at

    Hi @Abalderas ,

     

    Can you screenshot and past the query you are using in Get Items?

     

    The following steps i posted earlier should have returned 1st July 2021 and when used with Get Items, should return all files created prior to 1st July 2021.  The delete is part of the same loop so whatever files are returned in Get Items will be deleted.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 423

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 177

Last 30 days Overall leaderboard