Survey Design
Question Types
rank

The rank question type presents a list of choices that the respondent orders by preference or priority. It stores the result as a space-separated list of choice values in ranked order, with the highest-priority choice first.

rtSurvey web form: The drag-to-rank widget is not currently implemented. In the web form, rank renders as a select list. Use this type when targeting mobile clients that support the rank widget, or when the stored value format is more important than the drag-to-order interaction.

Basic XLSForm Specification

typenamelabel
rank prioritiesmain_priorityRank these community needs from most to least important

The choices are defined in the choices worksheet just like select_one:

survey:

typenamelabel
rank prioritiesmain_priorityRank these needs from most to least important

choices:

list_namenamelabel
prioritieswaterClean water
prioritieshealthHealthcare
prioritieseducationEducation
prioritiesroadsRoads
prioritieselectricityElectricity

Stored value format

The stored value is a space-separated list of choice values in ranked order (first = highest priority):

water education health roads electricity

Extracting ranked positions

Use selected-at() to get the choice at a specific rank:

typenamelabelcalculation
rank prioritiesmain_priorityRank community needs
calculatetop_priorityselected-at(${main_priority}, 0)
calculatesecond_priorityselected-at(${main_priority}, 1)

selected-at(${main_priority}, 0) returns the value placed first (index 0 = top rank).

Using rank-index() with repeat groups

When rank is used inside a repeat group, rank-index() lets you reference the ordinal rank from outside the repeat:

typenamelabelcalculation
calculatefirst_rankedrank-index(1, ${score})

See Functions — Repeated field functions for full details on rank-index() and rank-index-if().

Uses

Rank questions are commonly used for:

  1. Priority ranking — asking communities to rank development needs
  2. Preference ordering — ranking product features, service attributes, or policy options
  3. Exam item ordering — arranging steps in a process
  4. Top-N selection — combined with selected-at() to extract only the top 1, 2, or 3 choices

Best Practices

  1. Keep the list short (3–7 items) — ranking becomes cognitively taxing beyond 7–8 choices.
  2. Use clear, mutually exclusive choice labels to avoid confusion about what "first" means.
  3. Add hint text explaining the ranking direction (e.g., "Drag to order: first = most important").
  4. Validate using count-selected(.) = x if you need to ensure all choices are ranked.

Limitations

  • The drag-to-rank widget is not implemented in the rtSurvey web form.
  • You cannot partially rank — all choices must be ordered.
  • Keep lists to 3–7 items; longer lists become unwieldy regardless of client.