system.kanoa.dashboard.importWidget
Description
Imports widget information along with its widget categorySyntax
importWidget(exportInfo, userId)- exportInfo (dict): Dictionary that contains widget and widget category info
- userId (int) 
- widgetId (int): None if widget not created
- importLogs (list[string]): list of information about the import steps
Code Examples
# Example usage
userId = 5
widgetInfo = {
    "data": {
        "widgetCategory": {
            "changedDate": null,
            "widgetCategoryDescription": null,
            "widgetCategoryName": "Inputs",
            "createdDate": "2025-01-31 01:22:46.407",
            "createdBy": 5,
            "changedBy": null,
            "widgetCategoryId": 10,
            "enabled": true
        },
        "widgetInfo": {
            "widgetName": "Run Control Change",
            "widgetCategoryName": "Inputs",
            "widgetId": 59,
            "widgetPath": "Inputs\\Run Control",
            "widgetCategoryId": 10,
            "enabled": 0,
            "viewPath": "kanoa/mes/asset/operation/evRunControl",
            "path": "Inputs\\Run Control",
            "changedDate": null,
            "widgetDescription": null,
            "createdDate": "2025-06-05 20:09:46.337",
            "createdBy": 18,
            "changedBy": null,
            "sortOrder": null,
            "viewParams": "{\n  \"assetPath\": null\n}"
        }
    },
    "exportType": "widgetInfo"
}
system.kanoa.dashboard.importWidget(widgetInfo, userId)