Skip to main content
Community site session details

Community site session details

Session Id : cZyiiFOd/aJjVaIkCNE2iI
Power Automate - Using Flows
Answered

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

Like (2) ShareShare
ReportReport
Posted on 20 Apr 2022 05:00:19 by 34



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. 

  • AK007 Profile Picture
    34 on 09 May 2022 at 04:07:31
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    Hi @abm 

    Please find the snip , outputs have year and month folders

    AK007_0-1652069239470.png

     

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 06 May 2022 at 14:30:31
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    Hi @AK007 

     

    I can see a space in you folder path

     

    image.png

     

    After SAP_PLM/

  • AK007 Profile Picture
    34 on 06 May 2022 at 06:01:23
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    Hi @abm 

    PFA the snips

    AK007_0-1651816859115.pngAK007_1-1651816873000.png

     

     

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 05 May 2022 at 15:33:31
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    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

  • AK007 Profile Picture
    34 on 05 May 2022 at 12:18:46
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

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

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 05 May 2022 at 11:40:07
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    Hi @AK007 

     

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

     

    Thanks

  • AK007 Profile Picture
    34 on 05 May 2022 at 06:45:46
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    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"
    }

     

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 21 Apr 2022 at 08:22:48
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    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

  • AK007 Profile Picture
    34 on 21 Apr 2022 at 05:41:19
    Re: Take file created date and use within the flow to create subfolders while copying the files to another sharepoint

    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.

  • Verified answer
    abm abm Profile Picture
    32,506 Most Valuable Professional on 20 Apr 2022 at 22:34:27
    Re: Read dates from file name and use within the flow to create subfolders while copying the files to another 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

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

Featured topics

Restore a deleted flow
Loading complete