Skip to main content

Property Types (Collections) Data Model

COTPropertyType

Description

Property types, also know as collections, are versatile databases that can be set up to carry out diverse functions in the Cotalker environment. Property types can store company assets, describe workflow states, act as a filter, contain options for multiple-choice questions in surveys, grant permissions, and much more. Some common examples include "Store Locations", "Company Departments", "Products", "Clients", "Contacts", "Brands", "Task States", among others.

Property types contain properties or elements, which can be thought of as the rows in a table or better yet, as the documents in a MongoDB collection. Each property has at least a "Name", a "Code" and a "Unique Id". These fields are the basic columns of the table. But each collection may have more columns by adding fields, making properties more descriptive. For example, a collection that holds "store locales" can have additional fields that contain address, employee number, store size, performance indicators, or any other information that needs to be associated with the collection's properties.

JSON Sample

{
"_id": "61846a668e23c5b68db39552",
"code": "car_model_00",
"company": "61846bfc1c42ad26669a7017",
"createdAt": "2021-05-27T15:20:00.749Z",
"display": "Car Model",
"isActive": true,
"modifiedAt": "2021-05-27T15:20:00.749Z",
"schemaNodes": [ //Additional fields
{
"validators": {
"required": true,
"validator": [],
"min": 1,
"max": 20
},
"isArray": false,
"weight": 1,
"isActive": true,
"key": "origin",
"display": "Manufacturer Country",
"description": "Indicates the manufacturer's country of origin",
"basicType": "string"
},
{
"validators": {
"required": false,
"validator": []
},
"isArray": false,
"weight": 2,
"isActive": true,
"key": "car_picture",
"display": "Image",
"description": "Picture of the car model",
"basicType": "file",
"subType": "image"
}
],
"viewPermissions": [
"db-*-read"
]
}

Fields

FieldDescriptionTypeNote
_idSystem generated property type ID.ObjectId<COTPropertyType>
codeThe property type's unique identification name.stringMaximum 60 characters; only lowercase letters, numbers, and underscore allowed; must be unique.
companyIndicates the company the survey is found in.ObjectId<COTCompany>
createdAtDate the property type was created.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
displayThe property type's display name.string
isActiveIndicates whether the workflow is active or not.boolean
modifiedAtIndicates the last time the property type was modified.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
schemaNodesAdditional fields for all of the collection's elements.object[ ]
schemaNodes[index].basicTypeIndicates the additional field's input type.stringEnum: ["string", "number", "date", "boolean", "link", "file", "COTProperty", "COTUser"]
schemaNodes[index].defaultSpecifies the additional field's default value.Type according to basicType.Not yet implemented.
schemaNodes[index].descriptionBrief description of the additional field.string
schemaNodes[index].displayThe additional field's displayed name.string
schemaNodes[index].isActiveIndicates if the the additional field is active or not.boolean
schemaNodes[index].isArrayIndicates if the input type is an array or not.boolean
schemaNodes[index].keyThe additional field's code name.stringMaximum 60 characters; only lowercase letters, numbers, and underscore allowed; must be unique.
schemaNodes[index].subTypeAppears when basicType is set to "file" or "COTProperty".string"File" options: ["Video", "Picture", "File"]; "COTProperty" accepts COTProperty code.
schemaNodes[index].validatorsValidators' settings.object
schemaNodes[index].validators.arrayMaxMaximum number of elements in array inputs.number
schemaNodes[index].validators.arrayMinMinimum number of elements in array inputs.number
schemaNodes[index].validators.maxMaximum value of input type. Depending on basicType, values can represent characters, dates, numbers.number
schemaNodes[index].validators.minMinimum value of input type. Depending on basicType, values can represent characters, dates, numbers.number
schemaNodes[index].validators.requiredIndicates whether the additional field is required or not.boolean
schemaNodes[index].validators.validatorCustom validations.string[ ]Not yet implemented.
schemaNodes[index].visualizationSpecial input visualization settings.object
schemaNodes[index].visualization.displayAsAppears when basicType is set to "link".objectEnum: ["Embedded", "External", "Internal"]
schemaNodes[index].weightIndicates the order the additional field are listed in. Starts at "1".number
viewPermissionsPermissions that enable users to view the collection in the database viewer.string[ ]

Deprecated

FieldDescriptionTypeNote
createPermits non-admin users to create specific properties.objectDEPRECATED
create.activebooleanDEPRECATED
create.requiredPermissionObjectId<COTAccessRole>[ ]DEPRECATED
hierarchyLevelnumberDEPRECATED
newsLevelnumberDEPRECATED
sextrasString-extras. Deprecated, but still in use with some legacy settings.booleanDEPRECATED
skipCodeValidationWARNING: Do not set, disables many features. Deprecated, but still in use with some legacy settings.booleanDEPRECATED
visualizationobjectDEPRECATED
visualization.schemaNodesGroupsObject[]DEPRECATED

Additional Resources

Help