web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / move files to specific...
Power Automate
Unanswered

move files to specific folders but need to read portion of file name to set the path to folder, maybe lookup on excel sheet

(1) ShareShare
ReportReport
Posted on by

hi, i'm new to PAD but i allready see huge things i would like to do with the help of PAD.

 

i work in an office and every month we have to download arround 150 files from a site and save each file in a different folder :((( how can i set a flow to manage this kind of situation?

 

example of the files i download

 

RV_000000001_fsdfgewhadhwraH

RV_000000002_d2g23hgh2h24hh

RV_000000003_gwegwegWEHH3

RV_000000003_dfhwpghwehjwjh

DPM23_000000001_2023

DPM23_000000002_2023

DMRCMP_000000001_072_2024_5

DMRCMP_000000002_072_2024_5

 

so the first part of the name until the first "_" tells me what subfolder it has to go. the folder is given from the second part between the "_" where "000000001" 

 

for example

the "RV_000000001_fsdfgewhadhwraH" file would go to

c:\mydocuments\folderA\repository\RV_files\2024\january\

 

the "RV_000000002_d2g23hgh2h24hh" file would go to

c:\mydocuments\folderB\repository\RV_files\2024\january\

 

the "DMRCMP_000000001_072_2024_5" file would go to

c:\mydocuments\folderA\repository\DMRCMP_files\2024\january\

 

so i could have an excel sheet with the corresponding folder path for each 0000000001 number in the file name, so 000000001 means folderA, 000000002 means folderB

 

Am I complicating things?

 

i have no problem having different flows to each kind of subfolder, and also i could set manualy the year\month where to move.

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    You can use "Split Text" to split each file name by underscore.  For example, the first would make a list of words called %SplitText%, so RV_000000001_fsdfgewhadhwraH becomes:

    RV
    000000001
    fsdfgewhadhwraH

    Then, you can use %SplitText[0]% for "RV", %SplitText[1]% for the subfolderID.

     

    Finally you should be able to string together your path there and move as necessary.

     

    Let me know if something isn't working.

     

    Good luck!

  • Suggested answer
    mathiaskjeldsen Profile Picture
    224 on at
    Hey
     
    You can use Set Variable to capture the part of the filename you need, and then reference that variable when you are saving your file. I did it with date time when taking a screenshot here: Take screenshots and store them in folders - Power Automate Desktop
     
    I don't have a specific video for your particular situation, but I'm sure we can sort it out if the above doesn't help you. Let me know.
     
    Best regards
    Mathias Kjeldsen 
     
    ---
    If this has helped solve your problem, please mark it as Solution. 

    Connect with me on social platforms by using the links below.
    YouTube: https://www.youtube.com/@matkjeldsen 
    LinkedIn: https://www.linkedin.com/in/mathiaskjeldsen/

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard