Skip to main content

system.mes.dashboard.importFromJson

Description

Imports Dashboard Widgets from a JSON file provided as raw bytes. The service parses the JSON content and creates or updates widgets and their metadata accordingly.

Syntax

system.mes.dashboard.importFromJson(bytes)

Parameters

ParameterTypeNullableDescription
bytesByte[]FalseThe JSON file content as raw bytes.

Returns

An ApiResponse object indicating success or failure of the import.

NameTypeDescription
successBooleanIndicates if the import was successful.
messageStringDetails about the import outcome.
dataIntegerThe number of widgets imported (when successful).
errorStringError details if the import failed.

Code Examples

Perspective File Upload (onFileReceived)

def runAction(self, event):
jsonBytes = event.file.getBytes()
response = system.mes.dashboard.importFromJson(jsonBytes)
print(response)