Skip to main content

system.kanoa.dashboard.addUserDashboard

This function is part of the kanoaCore module

Description

Adds a new user dashboard entry

Syntax

addUserDashboard(userDashboardInfo, userId)
  • Parameters
      dashboardInfo (dict)
      - dashboardId (int)
      - userId (int): The user this dashboard is being added to
      - isDefault (bool)
      - isFavorite (bool)
      userId (int): used for the createdBy field
  • Returns
      int userDashboardId
      str msg - error message, None if successful
  • Code Examples

    # Example usage
    userDashboardInfo = {
    "dashboardId": 4,
    "userId": 7,
    "isDefault": True,
    "isFavorite": False
    }
    userId = 123
    dashboardId, msg = system.kanoa.dashboard.addUserDashboard(userDashboardInfo, userId)
    if msg: system.perspective.sendMessage('showFailerToast', msg)
    else: system.perspective.sendMessage('showSuccessfulToast', 'User Dashboard has been saved')