cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Community Support

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
Community Support

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

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!

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

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

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

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

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

 

Flow4.PNG

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (76,400)