Skip to main content

system.kanoa.attribute.addAttribute

This function is part of the kanoaOPS module

Description

Adds a new attribute.

Syntax

addAttribute(attrInfo, userId)
  • Parameters
      dictionary attrInfo - {'attributeName': 'some attribute name', 'attributeDescription': 'some description', 'parentId': 6, 'enabled': True}
      int userId - User ID
  • Returns
      int attributeId - Newly created attribute ID
  • 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