Client developers design a survey in JSON and provide either an API that can be used to retrieve this JSON or a JSON file located in a particular directory that can be read when processing responses.
The survey responses are submitted to the server as a JSON object. See example below:
Electronic data capture surveys are composed of a variety of question types. Review the options available in the core LabKey documentation:
Mobile App surveys support the option to have questions with an "Other" answer option for multiple choice questions, including those where many answers are allowed. The submitting user checks "Other" and also has the option to enter arbitrary text.
For example, a question "What medications are you taking?" could list a few common options, as well as an "Other" option for unlisted entries. Parameters in the definition of an "other" question are:
"textChoices" -
[
{
"text" - String
"value" - String
"detail" - String; nil
"exclusive" – Boolean
"destination" - String
"other": {
"textfieldReq" - Boolean
"placeholder" - String
"isMandatory"- Boolean
}
}
];
"selectionStyle" - String; Single/Multiple
The name of all the selected values, including the "Other" option is stored in the main result column. Any text entered as part of the Other option is stored in another column named with a _text extension. i.e. "ResponseColumn_text". If the user did not enter text, or if the Other option hasn’t been selected, this column is null.
Mobile apps submit data to the server using a POST URL, with the body of the POST being a JSON survey response document.