add_constant_sum_question
Create a constant sum question that lets respondents allocate values (like percentages) across a set of items, with an optional total to enforce summation.
Instructions
Simplified helper to create a constant sum question where respondents allocate values across items (e.g., percentages summing to 100). The default Choices/text-entry variation works in the New Survey Taking Experience; bars and slider variations require the legacy experience.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Array of item labels to allocate values across | |
| total | No | If set, entries must sum to exactly this total (e.g., 100) | |
| blockId | Yes | The block ID to add the question to | |
| selector | No | VRTL = Choices/text boxes (default; current experience compatible), HBAR = bars and HSLIDER = sliders (legacy experience only) | |
| surveyId | Yes | The Qualtrics survey ID | |
| questionText | Yes | The question text/instructions | |
| dataExportTag | No | Custom export tag (recommended; generated uniquely if omitted) | |
| forceResponse | No | Require a response (default: false) |