sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Renaming a folder is tricky; would be a good addition to this article

Open BobGerman opened this issue 8 years ago • 4 comments

The example "update a folder by using the MERGE method" posts JSON including 'Name': 'New name' which might lead readers to think they can rename a folder that way. It didn't work for me, instead I had to update the associated list item to rename the folder. Specifically:

GET https://site url/GetFolderByServerRelativeUrl('server relative URL of folder')/ListItemAllFields

From this, obtain the odata.type, such as SP.Data.Shared_x0020_DocumentsItem. Then POST to the same URL, using the same headers as in the folder update example and the following JSON:

{ '__metadata': { 'type': 'SP.Data.Shared_x0020_DocumentsItem' }, 'Title': 'New name', 'FileLeafRef': 'New name' }


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

BobGerman avatar Jul 03 '18 19:07 BobGerman

Didn't see your comment till after I figured out what the problem was. Wasted about a day on this. Microsoft's guidance up above on updating a folder is misleading and I wish they would fix their code to accommodate their guidance or update their guidance.

genteelish avatar Oct 22 '18 20:10 genteelish

Since leaving this comment, Microsoft has open sourced the documentation and now I was able to submit a pull request to change it. With any luck the correction will go live soon. Meanwhile, @genteelish I'm glad the comment helped though my sympathy for the time wasted ... I spent several hours figuring it out as well!

BobGerman avatar Oct 24 '18 14:10 BobGerman

Can we please get Power Automate screenshots in here for each of the flows? It's not easy to translate the text-only format into the Graphical User Interface of Power Automate.

jfgoodhew1 avatar Jan 13 '20 14:01 jfgoodhew1

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

msft-github-bot avatar Jan 27 '20 06:01 msft-github-bot