# Copy File

Copies a file to the destination folder in OneDrive or SharePoint. If `NewName` is empty, the source file name is used.


---

### :arrow_left:**INPUT**

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


---

### :arrow_right:**OUTPUT**

| **Parameter** | **Type** | **Description** |
|-----------|------|-------------|
| `IsOffice365CopyFileSuccessful` | `Boolean` | Operation success status |
| `Office365CopyFileMessage` | `String` | Status/error message |
| `Office365CopyFilePath` | `String` | Path of the copied file |


---

### :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**". |