Skip to main content
Version: V3 (Ignition 8.3)

system.mes.operation.exportAsCsv

Description​

Exports all Operations as raw bytes in CSV format (UTF-8 encoded). Streams operation data from the database and formats it as CSV, including a header row.

Permissions​

This method requires the OPERATION.READ.GET permission.

Syntax​

system.mes.operation.exportAsCsv()
system.mes.operation.exportAsCsv(locationIdsOrPaths)

Parameters​

Method 1: Export all operations​

ParameterTypeNullableDescription
None--This method does not take any parameters.

Method 2: Export operations for specific locations​

ParameterTypeNullableDescription
locationIdsOrPathsString[]TrueThe IDs or paths of the locations to export operations for. If omitted, all operations are exported.

Returns​

All operations as a CSV string (UTF-8 encoded).

Code Examples​

Perspective​

csvBytes = system.mes.operation.exportAsCsv()
system.perspective.download("operations.csv", jsonBytes)

Script Console​

csvBytes = system.mes.operation.exportAsCsv()
path = system.file.saveFile("operations.csv")
if path is not None:
system.file.writeFile(path, csvString)