# Rename File

Renames the file in the same folder. If `NewName` is empty, the current name is used.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `ConnectionSettings` | `PAWOffice365ConnectionSettings` | ✅Yes     | OneDrive or SharePoint connection settings |
| `SourcePath` | `String` | ✅Yes     | Current file path |
| `NewName` | `String` | ❌No      | New file name |
| `Overwrite` | `Boolean` | ❌No      | Overwrite if a file with the same name exists (default: false) |


---

### :arrow_right:**OUTPUT**

| **Parameter** | **Type** | **Description** |
|-----------|------|-------------|
| `IsOffice365RenameFileSuccessful` | `Boolean` | Operation success status |
| `Office365RenameFileMessage` | `String` | Status/error message |
| `Office365RenameFilePath` | `String` | New file path |


---

### :arrow_down:**MISC**

| **Parameter** | **Type** | **Default** | **Description** |
|-----------|------|---------|-------------|
| `ThrowException` | `Boolean` | ❌No     | Specifies whether an exception is thrown when the operation fails. The default value is "**No**". |