Survey Chats Data Model
Description
Each Survey Chat data model (COTSurveyChat) represents a component on a survey form. Usually, through the contentArray
field, two COTQuestion ObjectIds are paired together. One pertains to the component's title or displayed text, the other to the area for data input.
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" : "61436eb4dd1e5a60a302ea9a",
"__v" : 0,
"content" : "",
"contentArray" : [
"61436eb4dd1e5af41302eab6",
"61436eb4dd1e5a1e8302eab7"
],
"contentType" : "application/vnd.cotalker.survey",
"isActive" : true,
"isSystemModel" : false,
"modifiedAt" : "2021-09-16T16:20:04.438Z",
"order" : 0,
"sender" : "#system",
"survey" : "61436eb4dd1e5a023102ea8b"
}
Fields
Field | Description | Type | Notes |
---|---|---|---|
_id | The Survey Chat data model's ID code | ObjectId<COTSurveyChat> | |
__v | Version number | number | For internal system use only. |
content | This field stays empty | string | |
contentArray | Pairs the two parts of a survey component or question: one corresponds to the question title, the other to data input configuration | ObjectId<COTQuestion>[ ] | Question data model |
contentType | Indicates the content type | string | Default value: application/vnd.cotalker.survey |
isActive | Indicates if it is available for use | boolean | |
isSystemModel | If true, it cannot be changed, even by admins | boolean | |
modifiedAt | Indicates the last time it was modified | ISODate | YYYY-MM-DDTHH:mm:ss.SSSZ |
order | Indicates the represented question's place on the survey form | number | Lower numbers are higher on top |
sender | Indicates origin | string | Options: #system , #user |
survey | Indicates the survey the question corresponds to | ObjectId<COTSurvey> | Survey data model |
Additional Resources
- Surveys Overview: Complete description about surveys
- "Survey Chat" REST API documentation: basic "Survey Chat" API requests
- API documentation in Swagger: complete with data models (schemas)
- COTLang: use COTLang for extracting data from models in routines
- Triggers and Contexts: more information on using data models within routines
Help
- Cotalker Platform Community: post your questions or search for previous answers given in the forum