cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ashton
Frequent Visitor

Mirrored Delete from between Sharepoint Document Libraries

I am trying to control a document library's files from a separate document library in the same sharepoint site.

 

I already have a successful flow for copying the file over to the library I want.

 

I've had some success updating the copied file in the destination library when modifications are made to the original file in the source library.

 

The only thing I have had no success on is deleting the copied file in the destination library when the orginial file in the source library is deleted.

 

I believe I need to figure out how to identify the copied file, but I can't grab it by the unique file name with extension or anything else I've tried.

 

See screenshot of flow below:

image.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Could you please show me that how do you implement "control a document library's files from a separate document library in the same SharePoint site."

 

I understand that "Mirrored Delete from between SharePoint Document Libraries" is that copied file and original file have the same name with extension. When you delete the original file, the copied file is also deleted.

 

According to the flow of the screenshot you provided, the delete operation cannot be performed because the File identifier cannot be obtained.

 

Perhaps you could use "Send a Http request to SharePoint" action to delete the corresponding file.

 

As you said, I created a flow, Copy files from one SharePoint Online account or folder to another, used to synchronize files. Now they have the same file.

 

2.PNG

 

1.PNG

 

Use http delete request to delete files. Because the file names of the two files are the same, we can use the file name obtained by the previous action to determine the address of the file and Uri address, as below:

 

3.PNG

 

The flow works successfully as below:

 

4.PNG

 

For more details on SharePoint http request, please refer to link:

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

 

Please take a try and let me know if issue still exists.

 

Best Regards,

Barry

 

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

View solution in original post

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Could you please show me that how do you implement "control a document library's files from a separate document library in the same SharePoint site."

 

I understand that "Mirrored Delete from between SharePoint Document Libraries" is that copied file and original file have the same name with extension. When you delete the original file, the copied file is also deleted.

 

According to the flow of the screenshot you provided, the delete operation cannot be performed because the File identifier cannot be obtained.

 

Perhaps you could use "Send a Http request to SharePoint" action to delete the corresponding file.

 

As you said, I created a flow, Copy files from one SharePoint Online account or folder to another, used to synchronize files. Now they have the same file.

 

2.PNG

 

1.PNG

 

Use http delete request to delete files. Because the file names of the two files are the same, we can use the file name obtained by the previous action to determine the address of the file and Uri address, as below:

 

3.PNG

 

The flow works successfully as below:

 

4.PNG

 

For more details on SharePoint http request, please refer to link:

https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

 

Please take a try and let me know if issue still exists.

 

Best Regards,

Barry

 

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

View solution in original post

Thank you very much for the input. I tried the suggested steps, but now I am getting a Forbidden warning. I want the source library to be accessible for view only, but I don't want to allow users to delete items directly. It appears the HTTP request wants to see edit rights for the library?

 

EDIT: Nevermind I had the wrong user for the connection, it works now! Thank you!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,688)