cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dana_L
Regular Visitor

When a file is deleted in a SharePoint folder, delete file with the same name in a different SharePoint site folder

Hi, 

I have successfully completed a copy flow that will copy files that are created or modified in the originating SharePoint folder to a destination SharePoint site's folder. Now, I attempting to created a flow that will delete the file in the destination site's folder when it is deleted in the originating SharePoint site's folder. 

 

I reviewed a post from 2018 where someone was attempting the same flow (When a file is deleted in a SharePoint folder, del... - Power Platform Community (microsoft.com)). I have tried what was suggested (add an action to 'get folder metadata using path') unsuccessfully. I BELIEVE the problem is using the correct folder path for the Recycle Bin since the response is 'File not Found'. I've tried 'Trash', 'Recycle Bin' and the path that I see in the URL when I visit the Recycle Bin (/_layouts/15/).  (Screenshot below) So far, everything fails at the 'get folder metadata using path' action. 

 

Dana_L_1-1627069953646.png

 

 

Any help or advice would be greatly appreciated. 

 

Thanks!

 

2 REPLIES 2
eric-cheng
Solution Sage
Solution Sage

Hi @Dana_L ,

 

You can use the SharePoint API to query the recycle bin using oData.

 

Screenshot_20210724-134542_Chrome.jpg

 

Thanks

 

 --------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Hi @eric-cheng,

 

Thank you for your response. First, I'd like to admit and apologize for being a beginner!!

I'm editing my first reply since I made a rookie mistake and didn't follow your instructions to the letter. 

After making the corrections, the the 'Send an HTTP request to SharePoint' processes successfully. However, I'm now receiving a 404 error on the Delete File action - 'The response is not in a JSON format.' and 'The resource you are looking for has been removed, had its name changed or is temporarily unavailable.'  

When I view the output results from the 'Send an HTTP request to SharePoint', the site address and file identifier are correct. I'm able to copy and paste those into a browser window and the file is accessed. 

Any thoughts on why I'm getting this new error?

Thanks for your time and help,

Dana_L

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,236)