Skip to main content

system.kanoa.dashboard.addFolder

Description

Creates a new dashboard folder.

Syntax

addFolder(attrInfo, userId)

Parameters:
  • folderInfo (dict)
  • userId (int): User ID

  • Returns:
  • folderId (int): Newly created folderId
  • msg (str): error message, None if successful
  • Dictionary

    ParameterTypeRequiredNotes
    folderNamestringThe name of the folder. This must be unique within the parent folder
    folderDescriptionstringSome information about the folder
    parentIdintThe id of the parent this folder is going into. Use None if the folder is going onto the root.
    iconstringpath to the icon
    iconColorintThe color of the icon for this folder i.e '#FF0000' or '--KcRed-60'
    roles[string]list of roles that a user must have to view this folder
    sortOrderintDetermines the folders order within the folder. If None, then sorted by name.
    rowGapintThe gap between the rows
    columnGapintThe gap between the columns

    Code Examples

    # Example usage
    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')
    >