--- title: "system.vision.exportCSV" description: "Exports the contents of a dataset as a CSV file, prompting the user to save the file to disk." --- # system.vision.exportCSV > Exports the contents of a dataset as a CSV file, prompting the user to save the file to disk. :::info Backwards Compatibility This function replaces [system.dataset.exportCSV](versioned_docs/version-8.1/appendix/scripting-functions/system-dataset/system-dataset-exportCSV.md). Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. ::: This function is used in **Python Scripting**. ## Description Exports the contents of a [dataset](platform/scripting/python-scripting/variables-datatypes-and-objects/datasets.md) as a CSV file, prompting the user to save the file to disk. To write silently to a file, you cannot use the vision.export* functions. Instead, use the [toCSV()](appendix/scripting-functions/system-dataset/system-dataset-toCSV.md) function. ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.vision.exportCSV(filename, showHeaders, dataset)` ### Parameters Type | Parameter | Description ------- | ------- | ------- String |`filename` | A suggested filename to save as. Boolean | `showHeaders` | If true, the CSV file will include a header row. Dataset | `dataset` | The dataset to export. ### Returns **String** - The path to the saved file, or None if the action was canceled by the user. ### Scope Vision Client ## Code Examples ```python title="Code Snippet" # This snippet would prompt the user to save the data currently displayed in a Table component to a CSV file, # and would open the file (in an external program, presumably Excel) after a successful save. table = event.source.parent.getComponent("Table") filePath = system.vision.exportCSV("data.csv", 1, table.data) if filePath != None: system.net.openURL("file:///"+filePath.replace('\\','/')) ```