cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Updating a Document set with HTTP request to SharePoint - 404 File not found error

I am using the Karine Bosch approach to creating and updating a document set in SharePoint through an HTTP Request. Its been working fine, until recently it started throwing an error with one of my libraries when updating the metadata. My flow continues to create the doc set in the same library, and I can successfully find the doc set with a GET request. But when I go to update it gives me a 404 File not Found error.

 

I've already tried:

  1. PUT request (invalid for SP.Data type)
  2. POST with PATCH method (404)
  3. I've verified the SP.Data full name (ListItemEntityTypeFullName)
  4. Verified account permissions to the target library 
  5. duplicated the entire flow (404)
  6. Added a new connection (404)
  7. Created a manually triggered flow with an action from scratch (404)

Any suggestions are welcome!

 

POST REQUEST

 image.png

 

Response Body (ERROR)

 

 

 

 

{
  "status": 404,
  "message": "File Not Found.\r\nclientRequestId: 37532ce1-21e0-4277-85ad-f3d106c51da3\r\nserviceRequestId: bd8b449f-00cc-a000-8b77-7b0519dacfb8",
  "source": "https://contoso.sharepoint.com/sites/CORPClientProjects/_api/web/lists/getbytitle('Project%20Files')/items(701)",
  "errors": [
    "-2147024894",
    "System.IO.FileNotFoundException"
  ]
}

 

 

 

Thanks,

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate I
Advocate I

Re: Updating a Document set with HTTP request to SharePoint - 404 File not found error

I found the problem.

Power Automate's error message is misleading. The error was not in fact a 404 (File not found).

The error was actually in the body of the request. This HTTP Post request updates the FileLeafRef (file name) field in a sharepoint item in the library. And the new name had a space character as the last character in the string, as it was entered by the user triggering the flow. Like this:

"New File Name April 2020 "

Instead of giving me some kind of malformed request body error, it gave me a 404. This was misleading and had me looking in all the wrong places.  I hope this helps someone else!

 

To resolve the file name error I enclosed it in a Trim() function, this removes extra spaces at the beginning and end of the string.

View solution in original post

1 REPLY 1
Highlighted
Advocate I
Advocate I

Re: Updating a Document set with HTTP request to SharePoint - 404 File not found error

I found the problem.

Power Automate's error message is misleading. The error was not in fact a 404 (File not found).

The error was actually in the body of the request. This HTTP Post request updates the FileLeafRef (file name) field in a sharepoint item in the library. And the new name had a space character as the last character in the string, as it was entered by the user triggering the flow. Like this:

"New File Name April 2020 "

Instead of giving me some kind of malformed request body error, it gave me a 404. This was misleading and had me looking in all the wrong places.  I hope this helps someone else!

 

To resolve the file name error I enclosed it in a Trim() function, this removes extra spaces at the beginning and end of the string.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Users online (7,066)