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 / Copy file from one Sha...
Power Automate
Unanswered

Copy file from one SharePoint folder to another if the file name contains certain word

(1) ShareShare
ReportReport
Posted on by 17

Hi,

 

As the title suggests, I'm trying to copy files uploaded to one SharePoint folder to another if these files contain a specific text in their name. For example all files inside Folder A with names containing "What-If" will be copied to another folder named "What-If", files containing "Banquet Model" will be copied to a folder named "Banquet" etc. I tried different solutions posted in the forum but none of them seem to work. Any help would be greatly appreciated. TIA!

Categories:
I have the same question (0)
  • GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Hi @arit ,

     

    assuming that you want to do it just one time you can use the manual trigger. With the following process flow you can achieve this:

     

    - Manually Triggered

    - Get files (with filter which is checking your contains formulas)

    - move files (all files to the correct folder)

     

    I would work with scopes and copy them for all expressions. 

    In the filter you have to use FileLeafRef instead of Title. 

    Example:

     

    GeorgiosG_0-1661781061220.png

     

    GeorgiosG_1-1661781107410.png

     

     

     

     

  • arit Profile Picture
    17 on at

    Hi,

    Thank you for the reply. I'm completely new to power automate, so I'm still trying to navigate through and make sense of all the different elements. 

    Here are some more details if that helps: New files will be uploaded to the source folder constantly, so it won't be a one-time activity. Also, the file needs to be copied to the new folder not moved altogether. I'm trying to create a backup folder of some sort.

    Would it be possible to do this?

  • Verified answer
    GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Hi @arit ,

     

    if you are new to Power Automate I just recommend to just test things out 😉

    From the main logic it is the same what you want, instead of move file action simply use copy file.

    Trigger is changed from manually to When a file is uploaded, the construction with the condition is fine for your use case with two folder. 

     

    GeorgiosG_0-1661839449975.png

     

  • arit Profile Picture
    17 on at

    Thanks @GeorgiosG!

     

    I've recreated this flow and it works.

  • arit Profile Picture
    17 on at

    Hi @GeorgiosG,

     

    I realized that the file from the source folder disappeared altogether after being copied to the new folder even though the action is set to "Copy file" not "Move file". I was wondering if you had any idea on what went wrong with the flow. Here's my flow: 

     

    copy.png

  • GeorgiosG Profile Picture
    1,013 Super User 2024 Season 1 on at

    Shouldn't be the case. Can you check the recycle bin of the SharePoint site via site settings if the is the file you are searching for ?

     

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard