You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to rename a folder in a specific SharePoint site under the Shared Documents folder. My authenication and set up works (I am successfully creating Folders using a similar method) - however using the .rename() function from the Folder class is neither returning a renamed folder, or an error. My current code is below but I have tried many similar iterations:
I am sure I am selecting the right folder with folder = context.web.get_folder_by_server_relative_url(f'Shared Documents/{old_name}') - if I print the contents of the folder then I get the expected output for example.
In tests/test_sharepoint_folder.py, the test to update a folder suggests to change the "Name" property but I do not think this is the right approach. Changing the "Title" and "FileLeafRef" as in the rename method is the right approach looking at the SharePoint REST API docs.
Another thing to mention that using the logger, I can see my requests are POST, not the expected MERGE as mentioned in the docs (https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest)
Any help would be greatly appreciated! Thanks!
The text was updated successfully, but these errors were encountered:
Thank you for the thorough analysis and catching this bug, i confirm request payload was not correctly passed for rename endpoint and the last commit addresses this issue.
Since it would take some time before the changes will be published to pip, the latest version meanwhile could be installed from GitHub:
Hello 👋
I'm currently trying to rename a folder in a specific SharePoint site under the Shared Documents folder. My authenication and set up works (I am successfully creating Folders using a similar method) - however using the
.rename()
function from theFolder
class is neither returning a renamed folder, or an error. My current code is below but I have tried many similar iterations:I am sure I am selecting the right folder with
folder = context.web.get_folder_by_server_relative_url(f'Shared Documents/{old_name}')
- if I print the contents of the folder then I get the expected output for example.In
tests/test_sharepoint_folder.py
, the test to update a folder suggests to change the "Name" property but I do not think this is the right approach. Changing the "Title" and "FileLeafRef" as in therename
method is the right approach looking at the SharePoint REST API docs.Another thing to mention that using the logger, I can see my requests are POST, not the expected MERGE as mentioned in the docs (https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest)
Any help would be greatly appreciated! Thanks!
The text was updated successfully, but these errors were encountered: