Skip to main content
Community site session details

Community site session details

Session Id : VtOCat9CewIhLaSXKK+kS1
Power Automate - Building Flows
Unanswered

Moving SharePoint folders

Like (0) ShareShare
ReportReport
Posted on 12 Oct 2021 14:11:33 by 21

Hi all,

 

Currently I have flow that takes attachments from emails in a mailbox, moves them to Sharepoint and puts them in a folder based on the email subject and a sub-folder based on the month.  

 

Therefore they are currently in a Sharepoint library with the structure - Reports\Client Names\Month.

All of the Client names are unique - I wish to now move the month folders to  yearly folders without impacting the client name to have the structure Reports\Client Names\Year\Month

 

I can edit the original flow to put new email attachments in Yearly/Month folders but I'm not sure if I can move the existing folders as how can I identify the correct folders as all of the Client Names folders are unique and cannot be changed? 

 

Sorry - a bit long winded - hope that is clear enough!

 

Thanks, 

 

Steven

  • stevendunlop Profile Picture
    21 on 13 Oct 2021 at 14:12:42
    Re: Moving SharePoint folders

    Hi, 

     

    Thanks for this - I've been thinking of trying to do it another way using my existing flow to only move the folders when a new report sheet comes in as I could use the paths below to move.  I know that this would only move them when the report for that folder is received.  (I've just added "Year" in the path now) 

     

    What do you think would be the best flow to move all of these folders?  I could use the "Move Folder" flow but would I need some code as there are folders for each month?

     

    stevendunlop_0-1634133952517.png

     

  • ArchitectMadhan Profile Picture
    1,580 on 13 Oct 2021 at 03:55:58
    Re: Moving SharePoint folders

    @stevendunlop , you have two ways to achieve this

    1. by using Flow or

    2. using powershell. 

     

    1. Using Instant or Scheduled flow you can create a Year folder in the "Reports\Client Names\" and then move the Folder contents (Month) to "Reports\Client Names\Year\". Refer the below links for that

    https://powerusers.microsoft.com/t5/Building-Flows/Automate-moving-files-in-Sharepoint/td-p/322835

    https://www.chakkaradeep.com/2018/04/20/copy-or-move-files-from-to-sharepoint-using-microsoft-flow/

     

    2. Using PowerShell will be faster but you need to know how to code. For which you can have the file paths in excel file and use it as source or even you just hardcode it in the script.

    https://sharepoint.stackexchange.com/questions/255115/move-folders-along-with-sub-folders-and-files-to-another-existing-folder-with-me

     

    Please accept it as a solution and give thumbs up, If it works for you.

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

Announcing our 2025 Season 2 Super Users!

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

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!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete