Zum Inhalt

Parametertyping

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.

Single Input

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.

File

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.

Parameter mapping of single and multi files

Checkbox

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>.

Checkbox with single and multi choices

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 or 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>>.

Two nested dynamic panels

The question1 is in the outer dynamic panel, the question2 is in the embedded dynamic panel. See the following picture for the related parameters.

Parameters for the inner questions of dynamic panels

Matrix

There are three types of matrix questions in SurveyJs.

  • Single-Choice Matrix

    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>.

  • Multiple-Choice Matrix

    The Survey Datatype of the multiple-choice matrix is matrixdropdown. Such matrices allow multiple entries per row and have a cell type property that specifies the input types of individual cells. The default cell type is the Dropdown. For each matrix column, a parameter of type List with corresponding cell types is created 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>>.

    Cell type of multi-choice matrix
    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.
    Parameters of multi-choice matrix

  • Dynamic Matrix

    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.

Image picker

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
Radiogroup radiogroup STRING
Dropdown dropdown STRING
Comment comment STRING
Rating rating INTEGER
Ranking ranking List<STRING>
Boolean boolean BOOLEAN
Signature Pad signaturepad File
Expression(read-only) expression STRING
Multiple Text multipletext application/json
Tag box tagbox List<STRING>
Microphone microphone File
PDF text STRING

Multiple Text

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.

Signature Pad

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.

Draw and show signature

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.

Microphone

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.

No parameter for comment property