Skip to main content

system.kanoa.dashboard.addFolder(folderInfo, userId)

Create a new folder for storing dashboards


Parameters

folderInfo Dictionary

- folderDescriptionString
- folderNameStringThe name of the folder. This must be unique within the parent folder.
- iconStringThe path to the icon for this folder.
- iconColorStringThe color of the icon for this folder.
- parentIdIntegerThe id of the parent this folder is going into. Use None if the folder is going onto the root.
- roles[string]An array of roles that are able to view this folder.
- sortOrderIntegerDetermines the folders order within the folder. If None, then sorted by name

userId Integer


Returns

folderId Integer
message (string) None if successful


Example

folderInfo = {
"folderName": "Jason's Dashboards",
"folderDescription": None,
"icon": None,
"iconColor": None,
"parentId": None,
"roles": None,
"sortOrder": None
}
userId = 123
folderId, msg = system.kanoa.dashboard.addFolder(folderInfo, userId)
if msg: system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Folder has been saved')
>