Skip to main content

system.kanoa.dashboard.updateDashboard(dashboardInfo, userId)

Updates a dashboard.


Parameters

dashboardInfo Dictionary

- dashboardDescriptionStringSome information about the dashboard.
- dashboardIdInteger
- dashboardNameStringThe name of the dashboard. This must be unique within the folder.
- enabledBoolean
- folderIdIntegerThe id of the folder this dashboard is going into. Use None if the dashboard is going onto the root.
- iconColorStringThe color of the icon for this dashboard.
- iconPathStringThe path to the icon for this dashboard.
- privateBooleanIndicates if the dashboard is private or public. True for private, False for public
- rolesList of StringsAn array of roles that are able to view this dashboard.
- showOnMobileBooleanIndicates if the dashboard should be shown on mobile devices.
- sortOrderIntegerDetermines where within the folder the dashboard is placed relative to other dashboards. If the same as another dashboard, then sorted by name.
- widgetsDictionaryA dictionary of dashboardWidgets

userId Integer


Returns

# of records modified Integer
message string None if successful


Example

dashboardInfo = {
"dashboardId": 4,
"dashboardDescription": "Downtime By Asset",
"dashboardName": "Asset Downtime",
"enabled": True,
"folderId": 1,
"iconColor": "#AC5F00",
"iconPath": "kanoa/maintenance",
"private": False,
"roles": None,
"showOnMobile": false,
"sortOrder": None
}
userId = 123
retVal, msg = system.kanoa.dashboard.updateDashboard(dashboard, userId)
if msg: system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Dashboard has been updated')