cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AK007
Helper I
Helper I

Take file created date and use within the flow to create subfolders while copying the files to another sharepoint



I need to move a specific files with name "Rack_SKU_##_DD_MMM_YYYY_HH_MM_SS" pick the files from a shared drive location and move to SharePoint folders. This folder has other files as well. While moving this to the destination sharepoint, 

 

Month_Year based on current date should be picked and uploaded to sharepoint location.

 

Year and Month sub-folders to be created in the sharepoint if not already available
(Calculation should be based on month Present in file name minus 1)
Example:
> If Current Month is April 2022, the folder created should be 2022/Mar
> If  Current Month is January 2022, the folder created should be 2021/Dec

 

Appreciate all your help here. 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AK007 

 

Please have a look at my tutorial video.

 

https://youtu.be/J7amUp8Up4c

 

If you need any further help please let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

13 REPLIES 13
AK007
Helper I
Helper I

@abm 

abm
Super User
Super User

Hi @AK007 

 

Thanks for posting the question. I will post the solution soon.



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm  A little tweak in the ask, it doesn't have to read the dates from file name, we can simply take current date and minus 30 days from it while creating the folder in sharepoint. 

Say, the file was extracted today, 20th Apr, it needs to get copied in Mar 2022 folder on the sharepoint. 

Hi @AK007 

 

Please have a look at my tutorial video.

 

https://youtu.be/J7amUp8Up4c

 

If you need any further help please let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
AK007
Helper I
Helper I

Hi @abm 

Thanks for your assistance here.

I will be picking up the file from shared drive and not one drive. 
Also, there are other files on the shared drive, i want the flow to specifically pick  "Rack_SKU_##_DD_MMM_YYYY_HH_MM_SS" files. Can you please help me further on this one?

 

Thanks in Advance.

Hi @AK007 

 

So after the trigger add an IF condition action step to check the file name contains Rack_SKU_##. Here you can't check the full filename because of different date and time.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
AK007
Helper I
Helper I

Hi @abm 

The above solution worked, thank you very much 
but i'm running into a problem while creating folder in the sharepoint. 

it is throwing "Invalid Character in Create File in Sharepoint Document Library" error.

below is the error 

{
  "status"400,
  "message""The file or folder name \"sites/PLASTICTAXEUROPE/Shared Documents/Plastic Tax Automation/Automation/SAP_PLM/ 2022\" contains invalid characters. Please use a different name. Common invalid characters include the following: # % * : < > ? /  |\r\nclientRequestId: cee35b92-8ec3-476c-99db-984c01772f68\r\nserviceRequestId: cee35b92-8ec3-476c-99db-984c01772f68"
}

 

Hi @AK007 

 

Thanks for your reply. Check your filename. Looks like you have some invalid characters.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm Thanks for the reply, I ran a test run with file name "Taxation" and it still wasn't working.

Hi @AK007 

 

Without seeing the data its difficult to predict what's causing this. Could you expand your run history steps and post a screenshot.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
AK007
Helper I
Helper I

Hi @abm 

PFA the snips

AK007_0-1651816859115.pngAK007_1-1651816873000.png

 

 

Hi @AK007 

 

I can see a space in you folder path

 

image.png

 

After SAP_PLM/



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi @abm 

Please find the snip , outputs have year and month folders

AK007_0-1652069239470.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,264)