Skip to main content

system.kanoa.dashboard.addWidgetCategory

Description

Creates a new widget category

Syntax

addWidgetCategory(categoryInfo, userId)

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

  • Returns:
  • widgetCategoryId (int)
  • msg (string): error message, None if successful
  • Dictionary

    ParameterTypeRequiredNotes
    widgetCategoryNamestringThe name of the category
    widgetCategoryDescriptionstringSome information about the widget category
    enabledbool

    Code Examples

    # Example usage
    userId = 123
    categoryInfo = {
    "widgetCategoryName": "Analysis",
    "widgetCategoryDescription": "Contains analysis style widgets",
    "enabled": True
    }
    widgetCategoryId, msg = system.kanoa.dashboard.addWidgetCategory(categoryInfo, userId)
    if msg: system.perspective.sendMessage('showFailerToast', msg)
    else: system.perspective.sendMessage('showSuccessfulToast', 'Widget Category has been saved')