system.kanoa.dashboard.addWidgetCategory
Description
Creates a new widget categorySyntax
addWidgetCategory(categoryInfo, userId)- categoryInfo (dict)
- - widgetCategoryName (string): The name of the category
- - widgetCategoryDescription (string): Some information about the widget category
- - enabled (bool)
- userId (int)
- widgetCategoryId (int)
- msg (string): error message, None if successful
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')