Skip to main content

system.mes.location.exportAsJson

Description

Exports all Locations as a JSON string (UTF-8 encoded). Streams location data from the database and formats it as a JSON string, including a header row.

Syntax

system.mes.location.exportAsJson()

Parameters

No parameters.

Returns

All locations as a JSON string (UTF-8 encoded).

Code Examples

Perspective

jsonString = system.mes.location.exportAsJson()
system.perspective.download("locations.json", jsonBytes)

Script Console

jsonString = system.mes.location.exportAsJson()
path = system.file.saveFile("locations.json")
if path is not None:
system.file.writeFile(path, jsonString)