Documentation

Stable question identifiers

By default, MX8 Labs derives a question's reporting identifier from the question text. That works fine for one-off studies, but it has a sharp edge for any study you intend to re-run: if you change the wording, the identifier changes, and prior-wave data no longer lines up with the new wave.

To avoid this, every question method accepts an optional id keyword argument. When set, the platform uses this identifier as the question's stable reporting ID, and changes to the question text no longer affect it.

Basic usage

id is a string. It must be unique within the survey.

from survey import Survey

s = Survey(**globals())

s.rating_question(
    "Overall, how satisfied are you with our service?",
    id="overall_satisfaction",
    number_of_points=5,
)

s.multi_select_question(
    "Which of the following features have you used in the last 30 days?",
    options=["Reports", "Exports", "AI Copilot", "Visual Editor"],
    id="features_used_30d",
)

Once the survey has been fielded with an id, you can rewrite the question text in a later wave without breaking comparisons against earlier data.

When you'd want one

Set an explicit id when:

  • The survey is a tracker that you'll re-run quarterly or yearly. Wording almost always drifts.
  • You're using a template survey block and want the reporting identifier to be stable regardless of the brand or product piped into the text.
  • You're referencing the question from derived questions, recode scripts, or external API integrations and want a name that stays the same regardless of question text changes.
  • You want the identifier to read clearly in exports and the dashboard — overall_satisfaction is easier to scan than the auto-generated identifier.

Choosing an identifier

A few conventions that help:

  • Use snake_case so identifiers read well in code, exports, and SPSS.
  • Keep them short but specific — nps, q1_brand_awareness, features_used_30d.
  • Don't reuse IDs across questions, even when one supersedes another. If you're retiring a question, leave its ID alone and pick a new one for the replacement.

What happens if you don't set one

If you omit id, the platform generates a reporting identifier from the question text. That's still fine for short studies that won't be re-run, but be aware that even small text edits — fixing a typo, swapping a brand name — will produce a different identifier.

For background on how identifiers flow through into exports and downstream reports, see Adding metadata to questions and the Wide Excel format reference.