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



View solution in original post

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
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,554)