Saltar al contendio prinicipal

Questions Data Model

Advertencia

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

COTQuestion

Description

Questions make up survey forms; their wide variety allows different forms for gathering input. Apart from their different input types, questions are usually divided up into pairs: one COTQuestion represents the field label displayed in the survey form and another corresponds to the data input configuration.

graph LR; S[COTSurvey] --> C1[COTSurveyChat #1] S --> C2[COTSurveyChat #2] S --> C3[COTSurveyChat #3] 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

[
// COTQuestion that represents the field label displayed in the survey form
{
"_id": "615af821b0ca3100073e4f18",
"command": {
"commands": [],
"resetIdentifiers": [],
"values": []
},
"display": [
"Example Title Display"
],
"code": [],
"isActive": true,
"isSystemModel": false,
"contentType": "application/vnd.cotalker.survey+text",
"identifier": "unique_identifier_1633351713434",
"modifiedAt": "2021-10-04T12:48:33.669Z",
"textAlign": "left"
},
// COTQuestion that represents the question's data input configuration
{
"_id": "615af821b0ca3100073e4f19",
"command": {
"commands": [],
"resetIdentifiers": [],
"isCommanded": "item_list",
"values": [
{
"_id": "615af821b0ca3100073e4f1a",
"op": "eq",
"target": "op_1"
}
]
},
"display": [],
"code": [],
"isActive": true,
"isSystemModel": false,
"contentType": "application/vnd.cotalker.survey+textinput",
"help": null,
"identifier": "unique_identifier",
"isReadOnly": false,
"max": 5000,
"min": 0,
"required": false,
"subtype": "short_text",
"modifiedAt": "2021-10-04T12:48:33.674Z"
}
]

Fields

FieldDescriptionTypeNotes
codeDepends on the contentTypestring[ ]Check code details for content types that include QR scan & NFC and Map Locations.
commandConditional Display settingsobject
command.commandsIndicates which questions are commanded or depend on this question, i.e. questions using the command.isCommanded field.string[ ]The strings in the array corresponde to the questions identifier.
commmand.isCommandedIndicates if the question has Conditional Display settings.stringThe string corresponds to the commanding question's identifier.
command.restItentifiersstring[ ]
command.valuesSets the expected answers to activate the hidden question.object[ ]
command.values.opSelect the comparison criteria, i.e., the operator of the conditional.stringOptions are: =, eq: Is equal to; gte: Greater than or equal; lte: Less than or equal; regex: Regular expression.
command.values.targetWrite the identifier related to the commanding answer.stringFor multiple answers, use the following syntax: (example1)|(example2)
companyCompany identification codeObjectId<COTCompany>
contentTypeIndicates COTQuestionContentType, i.e. survey component typestringList of question content types
displayDisplayed question title or field labelstring[ ]Its contents depend on the contentType and whether the data model corresponds to the title section of the question.
execJavascript-automated questions (QuestionExec)object
exec.filterCurrently not in use.object<COTQuestionExecFilter>
exec.onChangeCode runs after validate, but not after initial value is set.object<COTQuestionExec>See Question Execution Data Model for more information.
exec.onDisplayCode executes when a survey is in editing mode, i.e., when a user opens the survey from the channel, and it is displayed for answering.object<COTQuestionExec>See Question Execution Data Model for more information.
exec.preloadThe code executes when the survey is created.object<COTQuestionExec>See Question Execution Data Model for more information.
exec.presaveRun code just before sending.object<COTQuestionExec>See Question Execution Data Model for more information.
exec.postsaveIf custom and internal validations are passed, the code executes after the survey is sent.object<COTQuestionExec>See Question Execution Data Model for more information.
exec.validateCode executes before internal validations and before sending the survey. This permits adding additional levels of validation (business guidelines, protocols, etc.).object<COTQuestionExec>See Question Execution Data Model for more information.
identifierUnique identification namestringMaximum 60 characters; only lowercase letters, numbers, and underscore allowed; must be unique.
isActiveIndicates if whether the question is active or notboolean
isReadOnlyUsers cannot enter or fill out a responeboolean
isSystemModelIf true, it cannot be changed, even by adminsboolean
maxDepending on the type of question, it could represent the maximum number of components or characters permittednumber
minDepending on the type of question, it could represent the minimum number of components or characters permittednumber
modifiedAtIndicates when the question was last modifiedISODateYYYY-MM-DDTHH:mm:ss.SSSZ
requiredUsers must answer the question in order to submit the formboolean
responsesContains submitted datastring[ ]Appended to model only in some contexts
skipCodeValidationInternal flag for legacy surveysboolean
subtypeIndicates the component's input type.stringOptions depend on the survey component type or contentType
textAlignIndicates alignment for displayed textstring

Deprecated

FieldDescriptionTypeNotes
symbolizesstring
groupObjectId<COTGroup>
hideEmptyboolean

Additional Resources

Help