cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarkG-ITC
New Member

Copy File to multiple folders and rename the file based on the folder name

Hi,

 

I am trying to create a copy of a file into multiple subdirectories and rename the file to include the name of the subdirectory in the file name, on sharepoint.

 

Eg.

Directory structure:

ParentDirectory-

            sub-directory1

            sub-directory2

 

Create a file in ParentDirectory:

file1.docx

 

The result would be:

ParentDirectory-

file1.docx

            sub-directory1

                                    sub-directory1.docx

            sub-directory2

                                   sub-directory2.docx

 

Any help appreciated.

 

Thanks

Mark

2 REPLIES 2
OceanA
Advocate IV
Advocate IV

Use the sharepoint Create file action to add the file all to the subdirectories you want. If you know the folder path of the subdirectories, you can use the Initialize a variable action to create an array of the subdirectories' paths, then apply to each path in the array, the file creation in sharepoint.

 

OceanA_0-1597000536546.png

 

 

Tom_Slosse
Memorable Member
Memorable Member

Hey @MarkG-ITC 

 

 

Did you try out the suggestion provided by @OceanA?

Please let us know if this worked for you

 

Kind regards

 

Tom



If this reply has answered your question or solved your issue, please mark this question as answered.

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,957)