Skip to main content

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

Create a new dashboard.


Parameters

dashboardInfo Dictionary

- dashboardDescriptionStringSome information about the dashboard.
- 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.

userId Integer


Returns

dashboardId Integer
message String None if successful


Example

dashboardInfo = {
"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
dashboardId, msg = system.kanoa.dashboard.addDashboard(dashboardInfo, userId)
if msg: system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Dashboard has been saved')