Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

(0) ShareShare
ReportReport
Posted on by 6

Hi All,

Can you please help with suggestions how can I setup a PowerAutomate flow to help me with the following Archiving issue:

I want to create a flow where different files are copied to different folders automatically, based on a Keyword contained in both (file name and folder name). 

1. I am filing .pdf of .doc or .xls files to different folder names, i.e.:

                   - files named    "295OE005 - MCB.pdf" and "295OE005 - SINC.pdf" are archived in folder named "295OE005 - AM                               Sydney"   AND

                   - files named    "294AS003 - BI.pdf" and "294AS003 - SINC.pdf" are archived in folder named "294AS003 OP                                        Melbourne" 

                   - and so on, for hundreds of key words and folders alike.

Is there any setup of PowerAutomate or AI to allow me to have this automatic flow (copying individual files from 1 folder TO multiple folders based on the keyword contained in both - file name and Folder name ?

Attached visual sample of what I described above.

thank you

 

  • AlexAlex81 Profile Picture
    6 on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    hi Dezhi,

    I am not yet too familiar on how to set it up. can you please type the path-way ?

    Really appreciate it !

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    Hi @AlexAlex81 ,

    Sorry, for some reason, I can't use the screen recording tool, you can try to build the flow based on my screenshots.

     

    Best Regards,

    Dezhi

  • AlexAlex81 Profile Picture
    6 on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    hi Dezhi,

    Thanks a bunch ! I am a newbie in P.A. and do not really know how to set it up. would it be possible for you to use the Recorder to show me the steps in setting this up ? 

    thanks anyway.

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    Hi @AlexAlex81 ,

     

    Please try this way.

    vdezhilimsft_3-1669256691349.png

    vdezhilimsft_4-1669256737705.png

     

    vdezhilimsft_0-1669256437295.png

    vdezhilimsft_1-1669256472584.png

    vdezhilimsft_2-1669256623500.png

    Rest Regards,

    Dezhi

  • AlexAlex81 Profile Picture
    6 on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    hi Dezhi,

    Thanks for quick reply.

    I want the files we copy into a "Source folder" to automatically copy to individual folders that we created, based on the keyword that is found in Both File_name and Destination_Foldername.

    For example, if I drag a file named "295OE005 - MRC sbn" into the Source_folder, the Keyword is 295OE005. So, I want the flow to copy it to a folder who's name Starts with 295OE005, i.e. Folder_Name: "295OE005 - OE Singapore" for example.

    Same to happen for any other file - to be copied to the relevant folder with common keyword.

    Not sure if I explained in a clear manner, please let me know. thank you

  • v-dezhili-msft Profile Picture
    Microsoft Employee on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    Hi @AlexAlex81 ,

    Do you want the files to be copied to folders with the same name with file names?

    I made a test for your reference.

    In my scene, both the file name and the folder name contain '-', I use split() to split them with '-' and put the same first half into the same folder.

    vdezhilimsft_0-1669183222096.png

     

    vdezhilimsft_1-1669183222097.png

     

    vdezhilimsft_2-1669183222097.png

     

    vdezhilimsft_3-1669183222098.png

     

    vdezhilimsft_4-1669183222099.png

     

    vdezhilimsft_5-1669183222100.png

     

    Best Regards,
    Dezhi
  • v-dezhili-msft Profile Picture
    Microsoft Employee on at
    Re: How can I copy files to individual folders based on different keyword contained in both (file name and folder name)

    Hi @AlexAlex81 ,

    Do you want the files to be copied to folders with the same name with file names?

    I made a test for your reference.

    In my scene, both the file name and the folder name contain '-', I use split() to split them with '-' and put the same first half into the same folder.

    vdezhilimsft_0-1669183222096.png

     

    vdezhilimsft_1-1669183222097.png

     

    vdezhilimsft_2-1669183222097.png

     

    vdezhilimsft_3-1669183222098.png

     

    vdezhilimsft_4-1669183222099.png

     

    vdezhilimsft_5-1669183222100.png

     

    Best Regards,
    Dezhi

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow