cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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
Highlighted
Super User III
Super User III

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!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

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!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Helper II
Helper II

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

Highlighted
Super User III
Super User III

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!

Learn more from my blog

Power Automate Video Tutorials

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,901)