system.kanoa.dashboard.addFolder(folderInfo, userId)
Create a new folder for storing dashboards
Parameters
folderInfo Dictionary
| - folderDescription | String | |
| - folderName | String | The name of the folder. This must be unique within the parent folder. |
| - icon | String | The path to the icon for this folder. |
| - iconColor | String | The color of the icon for this folder. |
| - parentId | Integer | The 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. |
| - sortOrder | Integer | Determines 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')
>