cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
markal09
Level: Powered On

Sharepoint- move files and create a folder based on month

Hi I would like to create a flow to automatically organize my document library.

I would like flow to automatically create a folder based on the year, and then within that folder one based on the month.

Then I would like to move files to each folder based on month.

 

Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Sharepoint- move files and create a folder based on month

Hi @ markal09,

 Could you please share more details about how would you move files to each folder based on month?Do you want to move files to each month folder according to the month when the file’s created?

 

If you want to move files to each month folder according to the month when the file’s created, you could refer to screenshot below to create the flow:

1.png2.png

The expression of year as below:

formatDateTime(outputs('Compose'),'yyyy')

 

The expression of month as below:

formatDateTime(outputs('Compose'),'MM')

 

The first Output dynamic content in the “Create file” action is from Year action, the second Output dynamic content in the “Create file” action is from month action.

 

The flow would run successfully as below:

 3.png

 

 

 

Regards,
Alice Zhang

View solution in original post

7 REPLIES 7
Community Support Team
Community Support Team

Re: Sharepoint- move files and create a folder based on month

Hi @ markal09,

 Could you please share more details about how would you move files to each folder based on month?Do you want to move files to each month folder according to the month when the file’s created?

 

If you want to move files to each month folder according to the month when the file’s created, you could refer to screenshot below to create the flow:

1.png2.png

The expression of year as below:

formatDateTime(outputs('Compose'),'yyyy')

 

The expression of month as below:

formatDateTime(outputs('Compose'),'MM')

 

The first Output dynamic content in the “Create file” action is from Year action, the second Output dynamic content in the “Create file” action is from month action.

 

The flow would run successfully as below:

 3.png

 

 

 

Regards,
Alice Zhang

View solution in original post

markal09
Level: Powered On

Re: Sharepoint- move files and create a folder based on month

Hi Alice,

 

Thank you for your response!

 

Yes, I would like to file to a each month folder according to the month it was created.

 

Would this flow create the folder for each month? Or will that be a manual process?

Also will it account for the year?

 

Thank you again for your response!

markal09
Level: Powered On

Re: Sharepoint- move files and create a folder based on month

Thank you after reveiwing the flow carefully I see it will acomplish the task for moving files based on month and year.

markal09
Level: Powered On

Re: Sharepoint- move files and create a folder based on month

The delete option deleted all files. If I remove the delete option I have duplicate files.

 

With all that being said I am closer to my goal, the it creates the Year and month folder and i see that it moves the files, but deletes all files in the end.

 

Thank you again

Community Support Team
Community Support Team

Re: Sharepoint- move files and create a folder based on month

Hi @ markal09,

 

 

Could you please share a screenshot of the configuration of your flow?

Have you check the flow that you created refer to my screenshot.

I have made a test on my side, an the flow would only delete the file that in the original folder, and the new created file wouldn't be deieted.

Please make sure the files are not in the month folder when the flow runs.I 'm afraid taht if the files are in the Year and month folder,when the flow runs, the flow wouldn't create the new file in the folder but the flow would delete the file in the last step.

 

Please take a try to save all files in a folder, and run the flow to see if the flow works.

 

 

Regards,
Alice Zhang

markal09
Level: Powered On

Re: Sharepoint- move files and create a folder based on month

Thank, the issue I faced was because I attempted to create a sub-directory with in the same folder. My work around was to create a separate library and it worked perfectly!!!

 

My next challenge would be to modify the "create file" step to copy the files to two separate libraries with the same structure

Flow1.PNGFlow2.PNGFlow3.PNG

markal09
Level: Powered On

Re: Sharepoint- move files and create a folder based on month

Simply added a steo before the delete step to accomplish copying the file to multiple locations. Thank you again!

 

Flow4.PNG

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,086)