# Datatable To File

Converts a `DataTable` object to a CSV file.


---

### :arrow_left:**INPUT**

| **Parameter** | **Type** | **Required** | **Description** |
|-----------|------|----------|-------------|
| `Data`    | `DataTable` | ✅ Yes    | DataTable to export |
| `Separator` | `String` | ✅ Yes    | CSV separator character |
| `FilePath` | `String` | ❌ No     | Target file path |
| `ColumnNames` | `String` | ❌ No     | Names of the columns to export |


---

### :arrow_right:**OUTPUT**

| **Parameter** | **Type** | **Description** |
|-----------|------|-------------|
| `IsDataTableToCsvFileSuccessful` | `Boolean` | Whether the operation succeeded |
| `DataTableToCsvFileMessage` | `String` | Status/error message |
| `DataTableToFileResult` | `Byte[]` | Binary content of the CSV 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**". |