Skip to main content

system.kanoa.dashboard.updateUserDashboard

This function is part of the kanoaCore module

Description

Updates a users dashboard entry

Syntax

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

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