cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeggyLang
Helper V
Helper V

When a new file is created in Sharepoint site A copy to Sharepoint site B

I have created a very simple flow;

When new file is created in Sharepoint site A copy file to Sharepoint site B

 
 

PeggyLang_2-1607053562744.png

 

The flow fails;

PeggyLang_3-1607053633730.png

I don't really understand why this is failing.  Do I have the incorrect dynamic content in the action?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @PeggyLang :

Please try this flow:

1.JPG

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @PeggyLang :

Please try this flow:

1.JPG

Best Regards,

Bof

@v-bofeng-msft  thank you very much.  That worked!! 
Have another question now.  The 'Source' library has a folder structure that is replicated in the 'Destination' library. 
The new file was added in 'Source' library to '2021 F5'.
The newly created file was added to root folder in 'Destination' library.  It needs to be in '2021 F5' folder of Destination library.  How do I have the file created in the appropriate folder?

Source Library

PeggyLang_1-1607089275820.png

 


Destination Library

PeggyLang_0-1607089240272.png

 

 

v-bofeng-msft
Community Support
Community Support

Hi @PeggyLang :

The key is to get the folder path of the newly created file and replace the root directory in the original path with the new root directory.Please try this:

1.JPG

Reference Expression:

substring(
triggerOutputs()?['body/{Path}'],
indexOf(triggerOutputs()?['body/{Path}'],'/'),
sub(length(triggerOutputs()?['body/{Path}']),add(indexOf(triggerOutputs()?['body/{Path}'],'/'),1))
)

Best Regards,

Bof

Helpful resources

Announcements
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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,044)