cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MangoMan09
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
abm
Super User III
Super User III

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 blogPower Automate Video Tutorials

View solution in original post

4 REPLIES 4
abm
Super User III
Super User III

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 blogPower Automate Video Tutorials

View solution in original post

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

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 blogPower Automate Video Tutorials

old stuff for you but still : thanks so much for posting your findings - i've been struggling for ages ....

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

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

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (39,638)