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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 269 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 184 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard