system.kanoa.dashboard.addUserDashboard
Description
Adds a new user dashboard entrySyntax
addUserDashboard(userDashboardInfo, userId)- 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
- 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')