Saltar al contendio prinicipal

Surveys Data Model

Advertencia

Esta página aún no se encuentra traducida al español.

COTSurvey

Description

Surveys are used to gather data from users. The Surveys Data Model (COTSurvey) is the main information of a survey and consolidates its other parts: COTSurveyChat, COTQuestion, COTAnswer.

graph LR; S[COTSurvey] --> C1[COTSurveyChat #1] S --> C2[COTSurveyChat #2] S --> C3[COTSurveyChat] C1 --> Q1T[COTQuestion - Field Label] C1 --> Q1I[COTQuestion - Input Settings] C2 --> Q2T[COTQuestion - Field Label] C2 --> Q2I[COTQuestion - Input Settings] Q2I --> QE[COTQuestionExec] C3 --> Q3[COTQuestion - Label & Input]

JSON Sample

{
"_id" : "614117b1dd1e5a64b1f93771",
"__v" : 0,
"code" : "maintenance_001",
"company" : "614117afdd1e5a3086f92020",
"createdAt" : "2021-09-14T21:44:17.778Z",
"groupPermission" : "61438ed076b99e7941b8ff09",
"groupPermissionsV2" : ["61439155467286620370b2a2", "6143916555dedbe9efe9baf0"],
"isActive" : true,
"isSystemModel" : false,
"modifiedAt" : "2021-09-14T21:44:17.778Z",
"name" : "Maintenance Order",
"onlyChannelCreation" : false,
"onlySubSurvey" : false,
"permissions" : ["614391becb12b21c7f6adc75"],
"permissionsV2" : ["report-surveys-read"],
"propertiesChannel" : ["equipment_section_01"],
"propertiesLimit" : ["machines_01"],
"responders" : [
{
"filter" : "accessrole",
"value" : "614393df19e63208e49d2297"
}
],
"skipCodeValidation" : false,
"version" : 1
}

Fields

FieldDescriptionTypeNotes
idThe survey's unique identification code.ObjectId<COTSurvey>
__vVersion number.numberFor internal system use only
codeThe survey'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 survey was created.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
editableDetermines if a survey can be edited after being submitted.objectGo to the Developer Mode Survey Editability section for more details on adding custom code to determine if a survey can be edited.
editable.modeIndicates the option selected to handle survey editability.stringOptions are:
enabled: Allows the survey to be edited after submission.
disabled: Prevents the survey from being edited.
advanced: Allows the use of custom code to program the logic that determines the survey's editability.
editable.contextIndicates the context from which data is extracted.stringCurrently, only the channel#task context is available which permits retriving data from the task channel associated with survey.
editable.srcContains custom Javascript code used to program the logic that determines survey editability.stringThe Javascript code is contained in string format.
groupPermissionLimits the use of the survey to the specified group.ObjectId<COTGroup>Soon to be deprecated and replaced by groupPermissionsV2.
groupPermissionsV2List of group object IDs, indicating the groups where the survey may be used. If empty, and groupPermission is not being used, the survey can be used in any group.ObjectId<COTGroup>[ ]
hiddenAllows including custom coded logic to determine survey availability.objectGo to the Developer Mode Survey Access section for further details.
hidden.contextIndicates the context from which data is extracted.stringCurrently, only the channel#task context is available which permits retriving data from the task channel associated with survey.
hidden.srcContains custom Javascript code used to program the logic that determines survey visibility.stringThe Javascript code is contained in string format.
isActiveIndicates if the survey is available for use.boolean
isSystemModelIf true, the survey cannot be changed, even by admins.boolean
modifiedAtIndicates the last time the survey was modified.ISODateYYYY-MM-DDTHH:mm:ss.SSSZ
nameThe survey's displayed name in the administrative panel.string
onlySubSurveyIf set as true, the survey can only be used within another survey, i.e., COTQuestionContentType survey+survey. booleanSurvey Component
permissionsUsers with at least one of the access roles listed can answer the survey.ObjectId<COTAccessRole>[ ]Soon to be deprecated and replaced by permissionsV2.
permissionsV2Users with at least one of the permissions listed can access the survey.string[ ]List of default permissions
propertiesChannelList of property types' (collection) code, indicating the property types (collections) that host the properties (elements) serving as filters. Must be used along with propertiesLimit to show the survey only on the channels that have the same property types and properties assigned.string[ ]
propertiesLimitList of properties' (element) name.code, indicating the properties (elements) that serve as filters for displaying the survey. Must be used along with propertiesChannel to show the survey only on the channels that have the same collections and elements assigned.string[ ]
respondersDesignates which users can answer the surveyobject[ ]
responders[index].filterIndicates the category or filter by which users will be selectedstringOptions: job, email, accessrole
responders[index].valueList of filter valuesstring[ ]
skipCodeValidationInternal flag for legacy surveysboolean
versionIndicates the survey version and determines what fields should be used; 1 uses fields prior to January 2019; 2 uses fields created after January 2019numberFields prior to January 2019: permissions, group, groupPermissions. Fields created after January 2019: permissionsV2, groupPermissionsV2, onlySubSurvey.

Deprecated

FieldDescriptionTypeNotes
ccSends a copy of the survey results to the indicated recipientsstring[ ]DEPRECATED
editChannelstring[ ]DEPRECATED
etls[ ]DEPRECATED
groupReplaced by groupPermissionV2ObjectId<COTGroup>DEPRECATED
identifiersNeededstring[ ]DEPRECATED
onlyChannelCreationLimits where the survey can be summoned from.booleanDEPRECATED
postSpecifies changes that occur after a survey-instance is saved or modifiedobjectDEPRECATED
post.changeNoticedefault or null (send notification to channel about change); none (do not send modification notice)stringDEPRECATED
propagateSqlbooleanDEPRECATED
propertiesNeededstring[ ]DEPRECATED
srcstringDEPRECATED

Additional Resources

Help