If you want to transfer data from one survey activity to another activity or otherwise use it in the process, you can access that data through parameters. Parameter handling in SurveyJs can be found under the chapter SurveyJS Creator. In the following we will show to which AdeptDataTypes the questions from the survey are mapped in order to provide the data in the process.
The default question in SurveyJ's Single Input is of type text, but this input type can be changed. For the text question type, parameters of the AdeptDataType.STRING type are created in our processes. The same applies to other string-compatible input types such as color, range, email, month, password, tel or week. If the Input type is number, it corresponds to the AdeptDatatype.FLOAT. Input type date, datetime, datetime-local and time is mapped to AdeptDatatype.DATE and url is mapped to AdeptDatatype.URI.
In surveys you can upload one or several files and store file content in JSON result as text, in this case they are inlined files. Single files are mapped to AdeptDataType.File and multiple files to List<USERDEFINED,File>> regardless of whether they are inlined or not.
Checkboxes can have multiple or only one choice. Those with only one choice are mapped to BOOLEAN, those with multiple choices are mapped to List<STRING>.
Panel and dynamic Panel¶
No parameter is created for the question type Panel or Dynamic Panel but depending on the type, suitable parameters are created for each inner question. The questions from the dynamic panel are mapped to lists of AdeptDatatype, e.g. a single input in dynamic panel has the parameter type List
<STRING>, a file in dynamic panel -> List<USERDEFINED,File> ... Dynamic panels can contain other dynamic panels. The hierarchy of the questions in these panels is transferred to the hierarchy of the parameter type e.g. a text question in the inner dynamic panel of two nested dynamic panels gets a parameter with the type List<USERDEFINED,List<STRING>>.
The question1 is in the outer dynamic panel, the question2 is in the embedded dynamic panel. See the following picture for the related parameters.
There are three types of matrix questions in SurveyJs.
The user can select in a single-choice matrix only one radio button in each row. Therefore a matrix is a list of rows where each list element is the name of the selected column. The parametertype for a single-choice matrix is List<STRING>.
The Survey Datatype of the multiple-choice matrix is matrixdropdown. Multiple entries pro row are possible with such matrices and they have the property Cell type which specifies the input types of individual cells. The default cell type is the Dropdown. A parameter of type List with corresponding cell types is created for each matrix column e.g. Column 1 (List<STRING>) Column 2 (List<STRING>)... If the column cell type is not default, then it is mapped to List<USERDEFINED,List<STRING>>. The third column in the previous image has the cell type checkbox, the others have the default type. The parameters for this are then created as in the following image.
The survey Datatype is matrixdynamic and the parameter typing is the same as with multiple-choice matrix only with changeable number of columns at runtime.
An image picker contains multiple images or videos to choose from. If only one can be selected, it is mapped to STRING, otherwise to List<STRING>. The multi-selection image picker has the property multiselect. If this is set to true, the values of the selected images or videos will be stored in the resulting JSONArray, as follows.
Image and HTML¶
No corresponding parameters are created for the question types Image and HTML but they can be used in the survey. These elements are used for presentation only and and cannot be changed at runtime. Their data is then stored in Survey Data and can be accessed there.
Table for parametermapping¶
The other survey question types supported in our processes and what AdeptDatatype they map to are shown in the following table.
|Question type||Survey Datatype||AdeptDatatype|
Multiple Text is handled like Survey Data and mapped to the user defined type application/json. This means, the udt value is taken directly from the survey without being converted into other data types. Assignment of a parameter of the type application/json as an input or output parameter works without any problems.
Signatures or any hand-drawn inputs can be recorded in a signature pad like in an image file. We treat the signature pad as a single file and can pass the content as an input or output parameter in a signaturepad question, see the next image.
Without using signature pad you can display a signature in a file question using a parameter of type File. This is better for security reasons, since a signature pad can be changed at runtime.
Just as with signature pad, microphone question is also mapped to parameter of type File. The audio recorded by the microphone question is base64 encoded in the resulting JSON as follows.
This audio data can be stored in a fileUdt and assigned as an audio file in a microphone question. The correct file extension for downloading and uploading the file is automatically detected.
Comment area Property¶
For many survey questions there is the possibility to add a comment. When this property is selected, the hasComment property in the resulting JSON is set to true.
We only create parameters for the question itself and not for the additional comment field in the question. Therefore, an info message appears in the report area, since the entered value for the comment is not directly available in the process (it can only be accessed via Survey Data). For example in ranking questions, the order of the listed items is determined by the user using drag and drop and it has the property of inserting a comment. The values for the order of the items and the comment are recorded in the resulting JSON. We create a parameter of type List<STRING> only for the order of the items and do not support the comment.