# Rename Folder
Renames a folder within a document library by processing rows from an Excel file.
Filename pattern: filename must contain renamefolder (case-insensitive).
Example: 20240115 renamefolder.xlsx
# Columns
| Name | Required | Description |
|---|---|---|
| Url | Conditional | Server-relative URL of the document library. Required when MatterCode is not provided. |
| ClientCode | No | Client code used together with MatterCode to identify the matter. |
| MatterCode | Conditional | Matter code used to resolve the document library from the matter list. Required when Url is not provided. Fails if the matter has more than one document library — use Url directly in that case. |
| Folder | Yes | Path of the folder to rename, relative to the document library root. Leading and trailing path separators are trimmed. |
| NewFolder | No | New name for the folder. |
| RecycleBin | No | Boolean. When true or empty, the old folder is moved to the recycle bin. When explicitly false, the folder is deleted permanently. Defaults to true when omitted. |
Either Url or MatterCode must be provided. Folder is always required.
# Behavior
The handler resolves the document library (from Url or MatterCode) and calls SPDocumentLibrary.RenameFolder. If the folder is not found, the row fails.
When MatterCode is used and the matter has more than one document library, the row fails — use Url to target a specific library.
RecycleBin defaults to true when the column is absent or empty.
# Related links
- Move Folder handler — move folders within or between libraries
- Delete Folder handler — delete folders
- Folder Set handler — create folder structures