Skip to main content

system.kanoa.dashboard.addFolder

This function is part of the kanoaCore module

Description

Creates a new dashboard folder.

Syntax

addFolder(attrInfo, userId)
  • Parameters
      folderInfo (dict)
      - folderName (string): The name of the folder. This must be unique within the parent folder
      - folderDescription (string): Some information about the folder
      - parentId (int): The id of the parent this folder is going into. Use None if the folder is going onto the root.
      - icon (string): path to the icon
      - iconColor (int): The 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
      - sortOrder (int): Determines the folders order within the folder. If None, then sorted by name.
      - rowGap (int): The gap between the rows
      - columnGap (int): The gap between the columns
      int userId - User ID
  • Returns
      folderId (int):Newly created folderId
      str msg - error message, None if successful
  • 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')
    >