Range
Range questions let respondents select a number by dragging a slider between a defined minimum and maximum value.
The range question type displays a slider (or equivalent input) that lets respondents pick a number within a defined minimum and maximum. It is ideal for collecting ratings, satisfaction scores, or any numeric value where you want to constrain the range visually rather than relying on a text input with constraints.
Basic XLSForm Specification
| type | name | label | parameters |
|---|---|---|---|
| range | satisfaction | How satisfied are you with the service? | start=1 end=5 step=1 |
The parameters column defines the slider bounds and step size:
| Parameter | Description | Default |
|---|---|---|
start | Minimum value (inclusive) | 0 |
end | Maximum value (inclusive) | 10 |
step | Increment between valid values | 1 |
For more details on the standard range question type, see the XLSForm specification.
Uses
Range questions are commonly used for:
- Satisfaction or rating scales (e.g., 1–5 or 0–10)
- Likert-style numeric scales
- Collecting measurements where only discrete values are valid
- Age brackets or score ranges where a slider improves usability over a text field
Example Usage
Basic rating scale
| type | name | label | parameters |
|---|---|---|---|
| range | overall_rating | Overall rating (0–10) | start=0 end=10 step=1 |
Decimal step
| type | name | label | parameters |
|---|---|---|---|
| range | weight_kg | Weight (kg) | start=0 end=200 step=0.5 |
Using the value in a calculation
| type | name | label | parameters | calculation |
|---|---|---|---|---|
| range | score | Test score (0–100) | start=0 end=100 step=5 | |
| calculate | grade | if(${score} >= 90, ‘A’, if(${score} >= 80, ‘B’, if(${score} >= 70, ‘C’, ‘F’))) | ||
| note | grade_note | Your grade is: ${grade} |
Appearance
The range type renders as a slider by default. No additional appearance values are required for basic usage. You can combine it with horizontal for a wider layout on web forms:
| type | name | label | parameters | appearance |
|---|---|---|---|---|
| range | nps | How likely are you to recommend us? (0–10) | start=0 end=10 step=1 | horizontal |
Best Practices
- Always set meaningful
start,end, andstepvalues — do not rely on defaults. - Label the ends of your scale in the
hintcolumn (e.g.,hint: 0 = Very dissatisfied, 10 = Very satisfied) to give respondents context. - For 5-point Likert scales, use
start=1 end=5 step=1rather than 0–4, since respondents expect “1” to mean the lowest. - Use
rangeinstead ofinteger+ constraint when the bounded nature of the input is part of the question design (slider communicates the scale visually).
Limitations
- The slider widget may not be ideal for very wide ranges (e.g., 0–10000) — a text
integerwith constraints is more user-friendly in those cases. - On mobile devices, fine step values (e.g.,
step=0.1) can be difficult to control precisely with a touch slider.