Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Trying to copy a file into existing folder, if folder doesn't exist created folder based off file name

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I should start by saying I'm entirely new to flow (minus a few approvals flows I've done recently). I am trying to create a flow that when a file is added to the library, it will copy the file into a different library and place it in an existing/new folder based off the file name.

 

However, if the folder doesn't exist within the library then create a new folder using the file name (refer to document names below) then copy the file and if the folder does exist to copy it in the correct folder based off the file name

 

ASP5C4567 - (Folder name)

- ASP5C4567 - Product Label - LABEL123.PDF (this will be a standard naming of all files uploaded)

- ASP5C4567- Box Label - BOXL123.PDF

- ASP5C4567 - Box Artwork - CBOX123.PDF

 

I wish I could show an example of what I have attempted, but I'm having a hard time even starting it.

 

If there is any more information that I can provide then, please ask.

 

Kind Regards,

Artur

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Trying to copy a file into existing folder, if folder doesn't exist created folder based off file name

    Hi @Anonymous,

     

    Instead of using copy file action, you could use the create file action to copy the file. The Create file action could create a folder in the Sharepoint library if the folder doesn't exist. For example, this is an instance that creates a file the folder path does not exist:

    Annotation 2020-08-10 134917.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • PrasadAthalye Profile Picture
    on at
    Re: Trying to copy a file into existing folder, if folder doesn't exist created folder based off file name

    Try something like below...

     

    PrasadAthalye_0-1596816061879.png

     

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1