Manage External Option Lists
External option lists let you manage large sets of options (e.g., occupation codes, university names) as separate Strapi content entries, rather than embedding them inline in a question. The app lazy-loads these lists for better performance.
Prerequisites
Section titled “Prerequisites”- Access to Strapi CMS
- A question of type
AUTOSUGGESTorDROPDOWN_SINGLE
1. Create an option list in Strapi
Section titled “1. Create an option list in Strapi”Navigate to Content Manager > Option list and create a new entry:
| Field | Description |
|---|---|
name |
Unique identifier for the list (e.g., hallescheBerufCodeList) |
values |
A dynamic zone accepting autocomplete-list or dropdown_single-list components. Each entry has a label (displayed) and value (submitted). |
Publish the option list when ready.
2. Link the list to a question
Section titled “2. Link the list to a question”On your AUTOSUGGEST or DROPDOWN_SINGLE question, open the question’s settings. Under props, find the Option List dropdown and select your option list entry. This links the question to the external list.
Both question types support two ways to load external options:
| Field | Description |
|---|---|
| Option List dropdown (props) | Links to an Option list entry in Strapi (preferred for CMS-managed lists) |
| externalList (props) | Points to a hardcoded list in the app code (legacy, for lists like breeds) |
Use the Option List dropdown for new lists.
3. How lazy loading works
Section titled “3. How lazy loading works”The app does not bundle external lists into the main questionnaire file. Instead, lists are loaded on demand when the user reaches the relevant question. Each list is imported dynamically, keeping the initial bundle small.
4. When to use an option list vs inline options
Section titled “4. When to use an option list vs inline options”| Scenario | Approach |
|---|---|
| Fewer than ~20 options | Use inline options or mapValue on the question props |
| 20+ options or frequently updated | Use an external Option list via cmsList |
| Options need search/autocomplete | Use AUTOSUGGEST with cmsList |
See also
Section titled “See also”- Question Types — reference for
AUTOSUGGESTandDROPDOWN_SINGLEprops - Add Question Types — how to add questions to a questionnaire
- Strapi Content Types — full schema reference for option lists and other content types
- Engineering: Run Sync — syncing updated content to the app