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 / Trying to copy a file ...
Power Automate
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 Microsoft Employee

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

Categories:
I have the same question (0)
  • PrasadAthalye Profile Picture
    on at

    Try something like below...

     

    PrasadAthalye_0-1596816061879.png

     

  • Verified answer
    v-litu-msft Profile Picture
    Microsoft Employee on at

    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.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 410

#2
Vish WR Profile Picture

Vish WR 289

#3
David_MA Profile Picture

David_MA 282 Super User 2026 Season 1

Last 30 days Overall leaderboard