Last modified: Jan 11, 2025

Code lists and options

How to set up code lists for components that use options

Several of the form components in Altinn 3 use options. By options, we mean a list of choices that can be selected by the user. In the most basic use cases you might set up a list of options directly in the component configuration, but often you’ll want to fetch the options from a code list.

Terms

There are subtle differences between the terms options and code lists:

  • Options: A list of choices that can be selected by the user. As an example, think of the contacts in your phone. When you use your contact list to call someone, you are selecting from a list of options, and your phone uses the selected value (the phone number) to call the person.
  • Code list: A list of codes and their corresponding value and texts. This can for example be the ISO 3166-1 country codes. This list contains codes (like NO or SE) and their corresponding labels (like Norway or Sweden).

When selecting a value from (for example) a Dropdown component, you are selecting from a list of options, which might be sourced from a code list. In that case, options is what they are, and a code list is where they came from.

Supported components

The following components support options:

ComponentTypeUse case
DropdownSingle choiceUsed to select a single option from a dropdown list.
RadioButtonsSingle choiceUsed to select a single option from a list of radio buttons.
ListSingle choiceUsed to select a single option from a list/table (with one radio button per row).
LikertSingle choice per rowUsed to select a single option per row in a table, displayed as a scale. Commonly used in surveys.
CheckboxesMultiple choiceUsed to select one or more options from a list of checkboxes.
MultipleSelectMultiple choiceUsed to select one or more options from a dropdown list.
FileUploadWithTagSingle choiceUsed to upload a file and tag it with an option.

In the categories below, you can learn more about how to produce a code list, configure that list to be used in a component in order to provide options in that component, as well as common functionality across the previously mentioned components that support options.

  • Sources

    The different sources for options in Altinn Studio

  • Functionality

    Common functionality for all option sources