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

Deleting a sharepoint item returns a 404

I am currently having this issue and I am not sure why this is happening.

 

In short, I am calling this flow on a PowerApp on a step where a user chooses to delete an entry on a Sharepoint list. Each Entry has a column with the path to an image.

 

With this in mind i figured that using a flow would be the friendliest  and quickest way to delete this file. As you can see below the steps are simple, one var for debugging sake and the deletion connector itself
delete photo from sharepoint.PNG

Here's where the trouble arises, whenever I try to run this I get a 404 error:

{
  "error": {
    "code": 404,
    "source": "europe-002.azure-apim.net",
    "clientRequestId": "ff47d7da-8bfa-4fd5-9482-b5decb9053d7",
    "message": "The response is not in a JSON format.",
    "innerError": "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
  }
}

delete photo from sharepoint fail 1.PNGdelete photo from sharepoint fail 2.PNG

I tried running the deletion connector by selecting the files manualy and it worked, I double checked the path text and they matched which left me confused.

Does anyone have an idea of what I am doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Deleting a sharepoint item returns a 404

Hi @MangoMan09 

 

You can't pass the filename as file identifier for deleting the file. You need the id of the file. You can get the id using 'Sharepoint - Get Items' flow action using the filter query matching the filename.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
Super User
Super User

Re: Deleting a sharepoint item returns a 404

Hi @MangoMan09 

 

You can't pass the filename as file identifier for deleting the file. You need the id of the file. You can get the id using 'Sharepoint - Get Items' flow action using the filter query matching the filename.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



View solution in original post

Highlighted
MangoMan09
Level: Powered On

Re: Deleting a sharepoint item returns a 404

Thanks @abm that really nudged me on the right path!

 

I was still unable to get the identifier to work directly after that but this tutorial helped me with the logic: https://powerusers.microsoft.com/t5/General-Discussion/Delete-SharePoint-document-library-document-u...

For those those who might need it here's the added steps:
delete photo from sharepoint fix.PNG

Super User
Super User

Re: Deleting a sharepoint item returns a 404

Hi @MangoMan09 

 

Good to know that you managed to resolve it. 

 

Please mark it as accepted answer and it help others in the community.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

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

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,938)