Edit as JSON
Survey Editor (Beta) can show a survey as JSON, a structured text format. Editing the JSON is a quick way to make lots of similar changes at once, copy questions between surveys, or check exactly how a question is set up.
There are two ways in:
- Edit as JSON in the header: the whole survey
- The JSON tab in the Properties pane: the selected question only
Edit the whole survey
Section titled “Edit the whole survey”- Click Edit as JSON in the header. The button only shows when you can edit the survey.
- Edit the JSON on the left. Press Ctrl+Space for suggestions, and hover over a field to see what it’s for. Question types and finish actions show their names next to their ids.
- Check the Problems panel on the right as you type. Click a problem to go to its line.
- Click Apply. If any warnings or problems are listed, the first click only shows them: read them, then click Apply again to go ahead. If you haven’t changed anything that can be applied, the dialog says Nothing changed and stays open.
- Save the survey. Applying only changes the survey in the editor.
To close without changing anything, click Cancel.
To make the dialog bigger or smaller, drag any edge or corner. The JSON editor and the Problems panel resize with it. The dialog opens at its normal size each time.
You can also paste in JSON copied from another survey. The JSON doesn’t include anything tied to one survey, such as ids, so it can be reused. Skip and Bucket questions you paste in are hidden automatically, as they are when you add them from the toolbar.
The Problems panel
Section titled “The Problems panel”| Section | What it means |
|---|---|
| Can’t apply | Errors. Fix these before you can apply. If an error shows a line number, click it to go to that line. |
| Check before applying | Warnings about what will happen, such as a question being added or deleted. Read them before you click Apply again. |
| Nothing to apply | Nothing has changed, or your changes can’t be made here (see below) |
| Problems | Other issues in the JSON, with their line numbers |
| Noticed when opening | Issues found in the survey when the dialog opened |
Watch for warnings like these:
- “question “Q5” is no longer in the JSON: it will be deleted”: you’ve removed a question. Applying deletes it from the survey.
- “question “Q12” is new: it will be added”: you’ve added a question
- “no question has code “Q3”, so the reference is cleared”: something, such as a skip or filter, refers to a question that isn’t in the survey
- “question “SKIP1” isn’t hidden, so the survey shows it as a blank page instead of skipping”: a Skip question has
"hidden": falseor no"hidden"line. Set"hidden": true.
What you can’t change here
Section titled “What you can’t change here”Some things are shown in the JSON but are kept as they are when you apply. The Problems panel tells you when this happens.
- Translations: changes to translated text aren’t saved yet. Use Import Translations instead.
- The survey stylesheet (
appearance.css). Edit the stylesheet in Resources instead. - A question’s type. Use Change Object Type instead.
- Question types Survey Editor (Beta) can’t edit. You can only move them or change their page group.
- Controls the question type doesn’t allow, and controls stored in the old
key=valueformat - An answer’s
quotaLimit, when the answer counts towards a quota. Change the limit with Edit Quota on the question’s card instead (see Survey quotas). A limit you give a new answer here is ignored until you save it in Edit Quota.
Download the schema
Section titled “Download the schema”Click Download schema to download survey-editor.schema.v1.json. It describes every field the JSON can contain, for use in other JSON tools.
Edit one question
Section titled “Edit one question”- Click the question’s card in the flowchart
- In the Properties pane, click the JSON tab. The question’s JSON is shown, locked.
- Click Edit
- Make your changes. Problems are listed as you type.
- Click Save. As with the whole-survey editor, if warnings are listed, click Save again to go ahead. If a Can’t save error shows a line number, click it to go to that line.
- Save the survey
To copy the question’s JSON, click the JSON options icon (⋮) > Copy. To see every field a question, answer or row can have, click JSON options (⋮) > JSON reference.
If you select another question or tab before saving your JSON changes, you’re asked whether to Save or Discard them.
Main parts of the survey JSON
Section titled “Main parts of the survey JSON”| Field | What it holds |
|---|---|
name, title, description | The survey’s name, the title respondents see, and its description |
defaultLanguage | The language respondents see first, as a language code |
invitationOnly | Whether only invited respondents can take the survey |
quotaLimit | The most completes the survey takes |
appearance | How the survey looks: theme, logo and stylesheet |
navigation | How respondents move through the survey, such as the Back button and progress bar |
languages | The languages the survey is translated into |
pageGroups | The survey’s page groups |
questions | The questions, in the order respondents see them, with their answers and rows |
formatVersion | The version of this JSON format. Don’t change it. |
Export definition
Section titled “Export definition”More editor actions (⋮) > Export definition downloads the survey’s full internal definition as a .json file, named after the survey and version (for example Customer survey-v3.json). It includes unsaved changes.
This file is a different format from Edit as JSON. Use it to keep a copy of the survey’s design, or when support asks for it. It doesn’t include any responses: to download responses, see Analyze results.