system.mes.operation.exportAsCsv
Description
Exports all Operations as a CSV string (UTF-8 encoded). Streams operation data from the database and formats it as a CSV string, including a header row.
Syntax
system.mes.operation.exportAsCsv()
system.mes.operation.exportAsCsv(locationIdOrPaths)
Parameters
Method 1: Export all operations
Parameter | Type | Nullable | Description |
---|---|---|---|
None | - | - | This method does not take any parameters. |
Method 2: Export operations for specific locations
Parameter | Type | Nullable | Description |
---|---|---|---|
locationIdOrPaths | String[] | False | The IDs or paths of the locations to export operations for. |
Returns
All operations as a CSV string (UTF-8 encoded).
Code Examples
Perspective
csvString = system.mes.operation.exportAsCsv()
system.perspective.download("operations.csv", csvBytes)
Script Console
csvString = system.mes.operation.exportAsCsv()
path = system.file.saveFile("operations.csv")
if path is not None:
system.file.writeFile(path, csvString)