Special Answers in Exports
This page shows how a choice question's None, Refuse to answer, Don't know, and Other answers are written in each export format. Use it to map an Endatix export onto another tool's dataset or codebook. For how to download an export in the Hub, see Exporting Submissions.
Stored values
SurveyJS stores each special item as a fixed value in the submission. Endatix exports read these values:
| Item | Stored value | Question types | Choosing it clears other choices |
|---|---|---|---|
| Other | other | Checkbox, tag box, radio group, dropdown, image picker | No |
| None | none | Checkbox, tag box, radio group, dropdown | Yes |
| Refuse to answer | refused | Checkbox, tag box, radio group, dropdown | Yes |
| Don't know | dontknow | Checkbox, tag box, radio group, dropdown | Yes |
Select All is never stored: it only ticks the question's other choices, so it has no column or category. A custom choice with isExclusive: true stays an ordinary choice in every export.
These are the SurveyJS default values (settings.noneItemValue, settings.refuseItemValue, settings.dontKnowItemValue). Choosing your own export codes for them is tracked in endatix#1544, and storing custom values in endatix#1606.
CSV, JSON, and XLSX
The Submissions formats write one column per flattened key. The key separator is __ unless the export format sets another keySeparator.
The examples use the native column names and values. An export format with the Crunch alias profile, or with -- as its key separator, writes the Crunch shape instead: columns are renamed Q1, Q1_1, and so on, grouped by question, and a single-select cell holds the choice's codebook id, as in csv-shoji, instead of none or refused.
Multi-select (checkbox, tag box)
Each choice and each special item gets its own indicator column, in this order: the question's choices, then Other, then None, Refuse to answer, and Don't know. A question that copies its source's Other (see otherFrom below) lists that Other last, after its own None, Refuse to answer and Don't know.
An indicator is 1 when chosen and 0 when not, except where the respondent may not have seen the choice: then the cell is empty (null in JSON). The rules below say when that is.
Conditional choices. choicesVisibleIf applies to every regular choice; visibleIf on a choice applies only to that value. A conditional choice exports as 1 if picked and empty otherwise, even on an answered question.
- The export reads conditions from the form version the respondent answered, in the question's own loop or at the root. Blank expressions do not hide choices.
- Removing a condition while keeping its choice allows an unpicked
0. Removing the choice leaves its retained column empty when the merged catalog records that it was conditional. - If the version, occurrence or choice is unavailable, the codebook's
choiceCatalogs[<question>].conditionalChoicessupplies the values kept across merge compiles. - Rows with a readable submitted version do not need a recompile. To rewrite stored indicators, an administrator with
forms.editruns a forced backfill for each affected completion scope.
An unanswered question with its own choices (0.9.3). It writes 0 for unconditional choices only in a completed submission and when nothing can hide it. Every column is empty:
- in an incomplete submission,
- when the question or an enclosing panel, dynamic panel or page has a
visibleIfor a staticvisible: false, - when the form uses its name for two questions,
- when the submission's form version did not have the question, because it was added later or removed earlier.
The codebook's choiceCatalogs[<question>].canBeHidden is true when any form version compiled since the last replace=true compile could hide it.
A question that copies its choices (choicesFromQuestion, or Hub carry forward). It writes 0 only for a choice the respondent was shown. With mode all, selected or unselected, the copy's shown rule rebuilds the shown choices from the source questions' answers in the same submission, or the same loop item first.
- A source can copy its choices too (0.9.3). Under
selected, the copy shows what that source picked. Underallorunselected, it shows what the source was shown, which the source's ownshownrule rebuilds. - The codebook's
choiceCatalogs[<question>].shownholds the rule:mode,sourceswith each source'snameandvalues, andwhenComplete. It is present only when the shown choices can be rebuilt. whenCompleteis set when the copy or a source has avisibleIf, its own or an enclosing panel's, dynamic panel's or page's, or when, underallorunselected, a copied source's own rule has it. The rule then holds only for a completed submission.- In a row where the rule holds only for a completed submission and this one is incomplete, every unpicked copied choice is empty. When a source has no answer in the row, an unpicked choice that no other source showed is empty.
- A copy with no answer is empty in every column.
There is no shown rule, and every unpicked copied choice is empty, when any of these holds:
- On the copy:
- an unrecognized mode,
edxCarryForwardMaxChoices(Hub carry forward),choicesVisibleIf,- a static
visible: falseon the copy or on an enclosing panel or page.
- On a source:
- a ranking,
- choices loaded from a data list or a URL,
choicesVisibleIfor a choice'svisibleIf,- a source that copies its choices through a chain that does not resolve, such as a cycle or a data list further up,
- under
allorunselected, a source that copies its choices and is not a checkbox or tag box with ashownrule of its own.
- On the form:
- a copy or source whose name the form uses twice (at the root and in a loop, or in two loops),
- a survey that keeps hidden answers (
clearInvisibleValuesset, and not toonComplete) with avisibleIfon any question, panel or page, - a copy or source whose own
clearIfInvisiblekeeps its answer while avisibleIfcan hide it, - a schema compiled before 0.9.2.
Other and the special items of a copy. These apply to an answered copy.
- An unpicked Other is
0when theshownrule holds and either the submission's form version showed the copy's own Other or its source picked Other with text. Otherwise it is empty. - When the shown choices can be rebuilt, the copy's own unpicked None, Refuse to answer and Don't know are
0, even when a source has no answer. In an incomplete submission where the rule holds only for a completed one, they are empty too.
Other copied from the source (otherFrom, 0.9.3). A copy of the choices its source picked (choicesFromQuestion with choicesFromQuestionMode: "selected") that shows no Other of its own gets the source's Other: SurveyJS adds it once the source picked it with a text.
- The copy stores
otherwith no text, so__other_textreads the copy's own non-empty text first, then the source's text, decoded with the submitted version's choices and storage settings. - Only if the submitted version is absent or unreadable does the export fall back to that source and its stored catalog. It does not assume the copy showed its own Other.
- A merge keeps the latest recorded
otherFrom, not a history of sources. - The indicator rules above still apply.
A loop item the respondent did not have. Every indicator of that item is empty.
Rankings. An unanswered ranking writes an empty cell for every choice; an answered one writes the rank, and 0 for a choice left unranked. A ranking that copies its choices writes an empty cell, not 0, for a choice left unranked.
For a checkbox cb with choices a and b, Other, None, Refuse to answer, and Don't know, a respondent who picks a and Other and types typed gets:
cb__a | cb__b | cb__other | cb__other_text | cb__none | cb__refused | cb__dontknow |
|---|---|---|---|---|---|---|
| 1 | 0 | 1 | typed | 0 | 0 | 0 |
In the JSON format, the same row is "cb__none": 0, a number, not a boolean. JSON property names are camel-cased, so a key that starts with a capital letter, such as QCb__none, is written as qCb__none.
Single-select (radio group, dropdown)
The question's column holds the stored value: a choice value, other, none, refused, or dontknow. The text typed for Other goes in <question>__other_text, whichever way the form stores it:
| Stored by SurveyJS | rg | rg__other_text |
|---|---|---|
"rg": "other" and "rg-Comment": "x" | other | x |
"rg": "x" (storeOthersAsComment: false) | other | x |
"rg": { "value": "other", "comment": "x" } | other | x |
"rg": "none" | none | |
"rg": "refused" | refused |
Choice comments
A checkbox, tag box, radio button group, or dropdown gets one text column per choice with showCommentArea: true (0.9.3): brands__item2__comment for choice item2 of brands, brands--item2--comment in csv-shoji, where the Shoji codebook declares it a text variable. The cell holds the comment stored on that picked choice, and is empty for an unpicked choice or a pick without a comment. Other text keeps its own column. Hub tag boxes do not collect choice comments, so their cells stay empty unless an imported answer carries a value and a comment.
The export reads the choice from the submitted form definition. When the definition cannot be read, or the answer could belong to another question type, the row is kept and the comment left blank; when it cannot be loaded, the backfill lists the submission in failedSubmissionIds.
A comment whose header would collide with another column or a Shoji ranking array takes the first free suffix (_2, _3, …), and keeps that header once published. A compile that would give a published header a second meaning returns 409 with errorCode: "ReportingSchemaAliasConflict" and keeps the previous schema (previousSchemaRetained: true). The same code also refuses a merge that cannot match a legacy matrix codebook to a historical definition; detail says which. For a header clash, rename the question or choice named in detail, then compile again.
Answers kept as stored
Two kinds of question keep the answer in one column as SurveyJS stored it, so a special item appears as its value:
- A multi-select that loads its choices from a data list or a URL and has no choices on the form:
["none"]. - A question in a dynamic panel without a loop source:
pd__0__pdRgisnone.
Questions in a dynamic panel with a loop source flatten like top-level questions, one set of columns per loop item, for example loop__nike__loopCb__dontknow.
Codebook
The Codebook format exports the form's codebook JSON. Its choiceCatalogs object lists every select question's choices with a numeric id. Special items follow the question's choices and Other. The one exception is a question that copies its source's Other (otherFrom): that Other comes last, after None, Refuse to answer and Don't know, so adding Other alone does not shift the earlier items.
"choiceCatalogs": {
"cb": {
"multiple": true,
"otherStorage": "comment",
"choices": [
{ "value": "a", "id": 1, "text": { "default": "a" } },
{ "value": "b", "id": 2, "text": { "default": "b" } },
{ "value": "other", "id": 3, "kind": "other", "text": { "default": "Other" } },
{ "value": "none", "id": 4, "kind": "none", "exclusive": true, "text": { "default": "None" } },
{ "value": "refused", "id": 5, "kind": "refused", "exclusive": true, "text": { "default": "Refuse to answer" } },
{ "value": "dontknow", "id": 6, "kind": "dontknow", "exclusive": true, "text": { "default": "Don't know" } }
]
}
}
| Field | Meaning |
|---|---|
multiple | true for checkbox and tag box, false for single-select questions. |
otherStorage | Where the Other text is: comment (a separate comment, the SurveyJS default) or value (the text replaces other: storeOthersAsComment: false, or a checkbox whose regular choice shows a comment box, which stores each checked item as an object such as {"value": "x"}). Only on questions with Other. |
otherFrom | The source's name, on a copy of the choices its source picked that shows no Other of its own, when the source shows Other (0.9.3). See Other copied from the source. |
id | The choice's code. A merge compile keeps it when choices are added, removed, or reordered: a new item takes the next free id. A replace compile assigns IDs in current choice order. A form that removed a choice before this rule existed has its later choices renumbered once, in its next Shoji export. |
kind | other, none, refused, or dontknow for a special item. Absent for an ordinary choice. |
exclusive | true when choosing the item clears the other choices, including a custom isExclusive choice. |
text | The label per locale, from the question's otherText, noneText, refuseText, or dontKnowText, or the SurveyJS default label. |
Each indicator column in columns names its item with choiceValue and choiceLabel, for example columns["cb__none"].
Crunch Shoji codebook and csv-shoji
A Crunch.io import takes two files: the Codebook (Shoji) metadata and the csv-shoji data. csv-shoji uses -- as its key separator, so cb__none becomes cb--none.
Single-select
A radio group or dropdown is a categorical variable. Its categories are the catalog's choices, with the same ids. Refuse to answer and Don't know are missing categories, so Crunch leaves them out of percentages. None is a valid answer.
For a radio group rg with choices a and b and every special item:
| id | name | missing |
|---|---|---|
| 1 | a | false |
| 2 | b | false |
| 3 | Other | false |
| 4 | None | false |
| 5 | Refuse to answer | true |
| 6 | Don't know | true |
csv-shoji writes the category id in the rg column, so a respondent who refused gets 5. An unanswered question writes an empty cell.
Multi-select
A checkbox or tag box is a multiple_response variable with one subvariable per choice and special item, such as cb--none. Every subvariable has the categories not selected (id 0) and selected (id 1), and neither is missing: in a multi-select, Refuse to answer and Don't know are selected or not selected like any other choice. csv-shoji writes 1, 0, or an empty cell where the native export is empty, which Crunch imports as No Data.
Other text
<question>--other_text is a separate text variable, named after the question with -- Other.
Category names
Crunch needs unique category names in a variable. When a removed choice and a current one share a label, every one but the newest is named with its value, as in Blue (b).
Forms prepared before special items were exported
A form whose reporting data was prepared before this behavior existed has no special-item columns. Run Rebuild reporting data… once on the form's export panel to add them. The special items take the next free ids after the existing choices.
Related
- Exporting Submissions: download exports and set up export formats in the Hub.
- Customize Exports: change values with transformers before they are written.