cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
BrisM900
Level: Powered On

Delete file from Sharepoint library at end of Flow

Hi,

 

I've seen some posts on this but I've not been able to get anything to work yet.

 

I have a Flow which runs through an approval process and after the final approval copies the file to a "frozen" library.

After that I want to delete the original file but it always fails with JSON error.

 

If I test by going into the Flow and manually selecting the file by folder then name it works, but if I obtain same "folder/file_name.extension" as dynamic content it fails, even though both are observationally the same.

 

I have also tried the HTTP REST DELETE method but can't get that to work either.

 

Any ideas?

 

Regards,

Paul

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Delete file from Sharepoint library at end of Flow

@BrisM900 

Mmmm... as you said, some posts point out that unless you get file identifier from your trigger, you would probably get a JSON error. 

THis second post explains how to do it via HTTP request via REST to delete it

Please note I haven't tested it myself

Hope this helps





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: Delete file from Sharepoint library at end of Flow

@BrisM900 

I guess you need the file identifier. See for example this post 

Hope this helps





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





BrisM900
Level: Powered On

Re: Delete file from Sharepoint library at end of Flow

Thanks, but I've tried file identifier too.

Dual Super User
Dual Super User

Re: Delete file from Sharepoint library at end of Flow

@BrisM900 

Mmmm... as you said, some posts point out that unless you get file identifier from your trigger, you would probably get a JSON error. 

THis second post explains how to do it via HTTP request via REST to delete it

Please note I haven't tested it myself

Hope this helps





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





View solution in original post

BrisM900
Level: Powered On

Re: Delete file from Sharepoint library at end of Flow

Thanks for jumping on this quickly @efialttes.

The reference to the HTTP helped, but I also needed this reference from Microsoft on working with files using REST api and adjusting the URL to reference ('/sites/site name/library name/file name.docx from dynamic content')/recycle as the example MS uses in their reference only uses ('/folder name/file name') which failed.

Dual Super User
Dual Super User

Re: Delete file from Sharepoint library at end of Flow

Thanks for sharing, @BrisM900 !





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

Proud to be a Flownaut!





Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,045)