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

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

@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
efialttes
Super User
Super User

@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!



Thanks, but I've tried file identifier too.

@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!



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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,514)