Skip to main content
Version: V3 (Ignition 8.3)

system.mes.location.exportPropertiesAsJson

Description​

Exports all or selected location properties as raw bytes in JSON format (UTF-8 encoded). Streams location property data from the database and formats it as JSON. When idsOrNames is omitted, all location properties are exported.

Permissions​

This method requires the LOCATION.READ.GET permission.

Syntax​

system.mes.location.exportPropertiesAsJson()
system.mes.location.exportPropertiesAsJson(idsOrNames=["Temperature"])

Parameters​

ParameterTypeNullableDescription
idsOrNamesString[]YesThe ids or names of the location properties to export. Omit to export all.

Returns​

A byte array (byte[]) containing the raw byte data of the JSON export.

Code Examples​

Perspective​

jsonBytes = system.mes.location.exportPropertiesAsJson()
system.perspective.download("location-properties.json", jsonBytes)

Script Console​

jsonBytes = system.mes.location.exportPropertiesAsJson()
path = system.file.saveFile("location-properties.json")
if path is not None:
system.file.writeFile(path, jsonBytes)