Skip to main content

system.kanoa.dashboard.updateDashboardWidget

Description

Updates a dashboards widget

Syntax

updateDashboardWidget(widgetInfo, userId)

Parameters:
  • widgetInfo (dict)
  • userId (int)

  • Returns:
  • retVal (int): # of records modified
  • msg (str): error message, None if successful
  • Dictionary

    ParameterTypeRequiredNotes
    dashboardWidgetIdint
    dashboardIdint
    breakpointIdint
    widgetIdint
    rowStartintThe top row for this widget
    rowEndintThe bottom row for this widget
    columnStartintThe left most column for this widget
    columnEndintThe right most column for this widget
    enabledboolean

    Code Examples

    # Example usage
    widgetInfo = {
    "dashboardWidgetId": 12,
    "dashboardId": 4,
    "breakpointId": 1,
    "widgetId": 7,
    "enabled": True,
    "rowStart": 8,
    "rowEnd": 8,
    "colStart": 2,
    "colEnd": 20,
    }
    userId = 123
    retVal, msg = system.kanoa.dashboard.updateDashboardWidget(widgetInfo, userId)
    if msg: system.perspective.sendMessage('showFailerToast', msg)
    else: system.perspective.sendMessage('showSuccessfulToast', 'Dashboard widget has been updated')