# Questionnaire

IDnGO allows you to create a verification step — a questionnaire (QUESTIONNAIRE) so that your users can answer questions or fill in data fields relevant to you.

# Configuration

Questionnaires are configured using the survey builder in the «Questionnaires» section of the Dashboard.

# Questionnaire structure

Warning:

The id of each item in the questionnaire must be unique. If you plan to modify the structure of the questionnaire, you cannot reuse existing ids.

Fields of the questionnaireDef element

Name Type Required Description
id String Yes Questionnaire identifier.
title String No Questionnaire title.
desc String No Questionnaire description.
sections Array Yes Sections of the questionnaire.

Fields of the sections element

Name Type Required Description
id String Yes Section identifier.
title String No Section title.
desc String No Section description.
condition String No Condition that determines whether the section is displayed depending on the value of sectionId.itemId={options.value} (see example).
items Array Yes Questionnaire items (data fields).

Fields of the items element

Name Type Required Description Value
id String Yes Item identifier. Any unique item identifier.
title String No Data field title. Any string value.
desc String No Data field description. Any string value.
type String Yes Data field type. See below.
required Boolean No Whether the data field is mandatory. true or false
format String No Data field format with validation. min:3, max:9 (sets min/max number of characters), email, etc.
placeholder String No Placeholder for the data field. Any string value.
options Array No Array of selectable values. [{"value": "someValue", "title": "Yes", "score": 0}]
condition String No Condition that determines whether the item is displayed. sectionId.itemId={options.value} (Example: 1-Section.1-2=someValue)

Available type values for items parameter

Value Description
text Text field.
textArea Expandable text area.
date Date field (format mm/dd/yyyy).
dateTime Displays calendar to select date and time.
bool Single checkbox.
select Use the options array to create radio buttons.
selectDropdown Use the options array to create a dropdown of selectable values.
multiSelect Use the options array to create multiple checkboxes.
countrySelect Dropdown of available countries.
fileAttachment Allows user to upload a file as an attachment.

Fields of the options array

Name Type Required Description Value
value String Yes The option selected by the user. Any unique item identifier.
title String Yes Option title displayed to the user. Any string value.
score Double No Adds value to the total questionnaire score (score). Double value.

# Retrieving results

To get the results of the questionnaire, use the applicant data retrieval endpoint.

Items of type fileAttachment contain the imageId value, which you can use to retrieve the uploaded file using this request.

Example

# Changing questionnaire language

You can change the questionnaire text for different languages (using the lang parameter when initializing the SDK). To do this, you need to provide a JSON structure of the questionnaire with translations in the questionnaires object. Each object inside .questionnaires corresponds to a questionnaire by its id.

Example

"questionnaires": {
    "questionnaireTranslate": { //id of a questionnaire to change texts
        "title": "I18n questionnaire title",
        "desc": "I18n questionnaire description",
        "sections": {
            "section1": { //id of a section to change texts
                "title": "I18n section title",
                "desc": "I18n section description",
                "items": {
                    "item1": {
                        "title": "I18n item title",
                        "desc": "I18n item description",
                        "options":{ //In case of multiselect options
                            "value1": "I18n option title 1",
                            "value2": "I18n option title 2"
                        }
                    }
                }
            }
        }
    }
}

# Resetting the questionnaire

To delete all active questionnaire data for an applicant, use the QUESTIONNAIRE parameter in the corresponding request.