cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

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



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
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



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

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 !



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

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!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (5,822)