cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft Graph Sharepoint Delete File does not work

EasyBluePrism
Level 4

I am trying to delete an Excel file in a Sharepoint folder. But I get the following error message:

EasyBluePrism_0-1715677670514.png

The IDs are correct because I can copy the file. In other words, the file is found. It’s probably because of the file path. For this I copied the link in Sharepoint. Is that right?

EasyBluePrism_1-1715677743782.png

 

1 BEST ANSWER

Best Answers

@EasyBluePrism let assume I have a folder titled Test Folder under my root SharePoint Documents folder, and in that folder is a file called TestSpreadsheet.xlsx that I want to delete. We can envision the structure like this:

Documents

  • Test Folder
    • TestSpreadsheet.xlsx

To delete that file, I would use the path Test Folder/TestSpreadsheet.xlsx. The reason is that, for this action, all files/folders are referenced relative to the root folder. You can see that if you take a look at the partial URL definition within the action.

Cheers,

Eric

View answer in original post

4 REPLIES 4

ewilson
Staff
Staff

The path should be relative to the root SharePoint drive. Right now, Graph doesn't understand what you're sending it, so it's looking specifically within the root drive.

Cheers,

Eric

@ewilson I tried two versions of the relative path (see screenshot), but in both cases I get an 404 error (ressource could not be found):

Expressions for delete file.png

So, how the relative path has to look like?

@EasyBluePrism let assume I have a folder titled Test Folder under my root SharePoint Documents folder, and in that folder is a file called TestSpreadsheet.xlsx that I want to delete. We can envision the structure like this:

Documents

  • Test Folder
    • TestSpreadsheet.xlsx

To delete that file, I would use the path Test Folder/TestSpreadsheet.xlsx. The reason is that, for this action, all files/folders are referenced relative to the root folder. You can see that if you take a look at the partial URL definition within the action.

Cheers,

Eric

Thank you very much. That solved my problem.

It would be a good idea to write in the help/description to this action that the path must be relative to the root folder.