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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,665)