Answer-Data Data Model
Advertencia
Esta página aún no se encuentra traducida al español.
Description
The Answer-Data Data Model (COTAnswerData) is an object that corresponds to the answers.data
array field found in the Answers Data Model (COTAnswer). It contains all the data gathered through a survey form submitted by a user.
Data objects usually go in pairs. The first represents the survey question's displayed field label. The second, the input data.
Location Survey Component
Click here for specific COTAnswerData field descriptions regarding the Location Survey Component, also known as survey+gps
.
JSON Sample
"data": [
// Survey question field label
{
"code": [],
"display": [
"Date of Arrival"
],
"responses": [],
"process": [],
"_id": "615c8c3bb478e900079e6076",
"user": "600ac7d8df54617a28ac89ff",
"question": "613fd2304a8541000782f313",
"contentType": "application/vnd.cotalker.survey+text",
"identifier": "date_arrival_00_1631572528245",
"diff": []
},
// Input data: Date and Time
{
"code": [
"date",
"timezone=America/New_York"
],
"display": [
"Date"
],
"responses": [
"2021/10/4",
"14:00"
],
"process": [
"1633363200000"
],
"_id": "615c8c3bb478e900079e6077",
"user": "600ac7d8df54617a28ac89ff",
"question": "613fd2304a8541000782f314",
"contentType": "application/vnd.cotalker.survey+datetime",
"identifier": "date_arrival_00",
"diff": []
},
// Survey question field label
{
"code": [],
"display": [
"Choose City"
],
"responses": [],
"process": [],
"_id": "615c8c3bb478e900079e607a",
"user": "600ac7d8df54617a28ac89ff",
"question": "615ae3e7b0ca3100073e467c",
"contentType": "application/vnd.cotalker.survey+text",
"identifier": "cities_00_1633346534779",
"diff": []
},
// Input data: Multiple Choice using Properties (Elements)
{
"code": [
"{\"allow\":\"propertyType\",\"value\":\"location\",\"filter\":\"*\"}"
],
"display": [],
"responses": [
"{\"_id\":\"613fd0154a8541000782eb14\",\"subproperty\":[],\"isActive\":true,\"name\":nyc_00\",\"display\":\"New York\"},\"propertyType\":\"location\",\"600ac7d8df5461626aac89c0\",\"createdAt\":\"2021-09-13T22:26:29.673Z\",\":\"2021-09-13T22:26:29.686Z\"}"
],
"process": [
"613fd0154a8541000782eb14"
],
"_id": "615c8c3bb478e900079e607b",
"user": "600ac7d8df54617a28ac89ff",
"question": "615ae3e7b0ca3100073e467d",
"contentType": "application/vnd.cotalker.survey+property",
"identifier": "cities_00",
"diff": [
{
"_id": "615c8c3bb478e900079e607c",
"op": "remove",
"path": "/responses/0",
"modifiedAt": "2021-10-05T17:32:43.598Z"
}
]
}
],
Fields
Field | Description | Type | Notes |
---|---|---|---|
code | Displays code parameters according to the content type. | [string] | Click here for an example using survey+gps content type. |
contentType | Indicates the question's content type. | string | |
diff | Each diff object indicates changes or modifications made to an answer after the form was submitted. | object[ ] | The diff field follows RFC6902 standards. |
diff[index].from | Indicates origin of moved or copied data. | string | Not present in all operations. |
diff[index].modifiedAt | Indicates when the modification took place. | ISODate | YYYY-MM-DDTHH:mm:ss.SSSZ |
diff[index].op | Indicates the type of modification carried out. | string | remove , replace , add |
diff[index].path | Points to the responses or code path that was modified. | string | |
diff[index].value | Depending on the content type, shows the previous value that was modified. | string | |
display | Indicates the displayed field label in the survey. | [string] | Only present in objects that represent the survey field labels. |
identifier | Indicates the question's unique identification name. | string | |
process | Shows the input data that will be processed. | [string] | |
question | References the asked survey question. | ObjectId<COTQuestion> | Questions Data Model |
responses | Shows the input data after being processed. | [string] | |
user | Indicates the user that submitted the form. | ObjectId<COTUser> | Users Data Group |
Deprecated
Field | Description | Type | Notes |
---|---|---|---|
group | string | DEPRECATED |
Additional Resources
- Surveys Overview: complete description about surveys
- Reports: view submitted survey answers
- "Answers" REST API documentation: basic "Answers" 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