q1 or nps. Every answer option has an answer code, such as 1 or 98. Codes are the names used in the Analysis export, in webhooks, and in prefill and start-at links.
Question codes
Formbricks sets a code for every question: the next unusedq1, q2 and so on. Moving or deleting questions never renumbers the others. You can change a code while the survey is a draft, for example to nps, age_group or adm01.
A question code:
- starts with a lowercase letter, followed by lowercase letters, digits and
_ - has no two
_in a row and does not end with_ - is at most 30 characters long
- is unique in the survey, ignoring case. It cannot match another question code, a hidden field or variable name, or the Question ID of another question
- does not give the export a column another question already has. A multi-select question coded
q2with the option code1makes a columnq2_1, so another question cannot be codedq2_1. The same goes for the Other text column (q2_text) and for the rows of a matrix question - is not one of the words SPSS reserves (
all,and,by,eq,ge,gt,le,lt,ne,not,or,to,with), and not the name of a column the export writes itself, such asresponse_id,language,outcome,timestamporfinished
The rules are short and strict on purpose. Codes end up in SPSS variable names, URLs and webhook keys, where capitals, spaces and double underscores cause trouble. Call centre style names such as
ADM01 become adm01.Answer codes
Answer options, matrix rows and matrix columns have answer codes. They default to1, 2, 3 and so on in the order the options were created, and you can change them while the survey is a draft, for example to 98 for “Don’t know” or 99 for “Prefer not to say”.
An answer code:
- uses lowercase letters, digits and
_, and may start with a digit - is at most 20 characters long
- is unique within its question
- is never reused for another option in the same question
Where to set codes
1
Open the question settings
Open a question in the survey editor and go to its Settings tab.
2
Change the codes under Recode
The Recode section holds the question code and the answer codes of the question. Reset all puts the codes of this one question back to the defaults. It is only available while the survey is a draft.
Question IDs and option IDs
Codes are separate from IDs. Every question also has a generated Question ID, and every option an Option ID. Responses are stored under these IDs, so they never change and cannot be edited.- To copy a Question ID, choose Copy question ID in the question’s ⋯ menu.
- To copy an Option ID, choose Copy option ID next to the option.
What locks when you publish
A survey is published once it has left draft: active, paused or completed. A scheduled survey counts as published from the moment you schedule it. From then on:- question codes and answer codes cannot be changed
- the question type cannot be changed, for example from Single-select to Multi-select, because it changes the columns of an export. For a Picture selection, the single or multiple selection setting is locked too
- the text of an option cannot be changed, in any language
- an option that existed when the survey was published cannot be deleted. Add a new option instead
Locks and the API
The lock is enforced on the server, not only in the editor. An API or MCP client that changes a locked field of a published survey gets an error:PATCH /api/v3/surveys/{surveyId}and the MCP tools answer422with aninvalid_paramsentry codedimmutable_question_code,immutable_answer_code,immutable_question_type,immutable_option_textorimmutable_option_deletion.PUT /api/v1/management/surveys/{surveyId}and the editor answer with a message that starts withpublished_survey_locked:. The editor shows it as “Your changes were not saved”.