system.mes.equipment.importPropertiesFromCsv
Description
Imports Equipment Properties records from a CSV file provided as a string or as raw bytes.
Recommended to export at least one pre-existing equipment property to CSV using the exportPropertiesAsCsv functionality to ensure the correct format.
Permissions
This method requires the EQUIPMENT.WRITE.SAVE permission.
Syntax
system.mes.equipment.importPropertiesFromCsv(importString)
system.mes.equipment.importPropertiesFromCsv(importBytes)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
importString | String | False | The CSV content as a string. |
importBytes | PyArray | False | The CSV content as raw bytes. |
Returns
Returns an ApiResponse containing import result details.
| Name | Type | Description |
|---|---|---|
success | Boolean | Indicates if the import was successful. |
message | String | A summary of the import result. |
data | String | Details about the imported records. |
error | String | Any errors encountered during import. |
Code Examples
Bytes
def runAction(self, event):
csvBytes = event.file.getBytes()
system.mes.equipment.importPropertiesFromCsv(csvBytes)
String
def runAction(self, event):
csvString = event.file.getString()
system.mes.equipment.importPropertiesFromCsv(csvString)