Skip to main content

system.mes.dashboard.validateWidget

Description

Validates the specified parameters for a Dashboard Widget and returns any validation errors. This does not save the object.

Syntax

system.mes.dashboard.validateWidget(**widget)

Parameters

ParameterTypeNullableDescription
nameStringFalseThe user-friendly name of the widget.
descriptionStringTrueDescription of the widget functionality.
viewPathStringFalsePath to the Ignition View that renders the widget.
iconPathStringTruePath to an icon for the widget.
categoryStringTrueCategory of the widget.
defaultWidthIntegerFalseDefault grid width of the widget.
defaultHeightIntegerFalseDefault grid height of the widget.
minWidthIntegerFalseMinimum grid width allowed.
minHeightIntegerFalseMinimum grid height allowed.
idStringTrueThe ULID of the widget.
notesStringTrueNotes related to the widget.
enabledBooleanTrueIndicates if the widget is active and enabled.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.

Returns

Returns a JSON object where keys are field names and values are lists of validation violation messages.

Code Examples

w = system.mes.dashboard.newWidget()
w['name'] = '' # invalid
violations = system.mes.dashboard.validateWidget(w)
print(violations)