Renaming a folder is tricky; would be a good addition to this article
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.
- ID: da51381a-7a39-8c31-8af8-b05ecafc377a
- Version Independent ID: 693ecf1c-8e75-1f61-0264-fbdefaff0968
- Content: Working with folders and files with REST
- Content Source: docs/sp-add-ins/working-with-folders-and-files-with-rest.md
- Product: sharepoint
- GitHub Login: @spdevdocs
- Microsoft Alias: spdevdocs
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.
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!
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.
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