Skip to main content

system.kanoa.attribute.addAttribute

Description

Adds a new attribute.

Syntax

addAttribute(attrInfo, userId)

Parameters:
  • attrInfo (dict): Attribute information
  • userId (int): User ID

  • Returns:
  • attributeId (int): Newly created attribute ID
  • Dictionary

    ParameterTypeRequiredNotes
    attributeNamestring
    attributeDescriptionstring
    parentIdint
    enabledbool

    Code Examples

    # Example usage
    attrInfo = {
    'attributeName': 'some attribute name',
    'attributeDescription': 'some description',
    'parentId': 6,
    'enabled': True
    }
    userId = 123
    attributeId = system.kanoa.attribute.addAttribute(attrInfo, userId)
    print(attributeId) # Print the newly created attribute ID