Code Lists
Reusable option lists for attributes and controlled values in templates.
User guide navigation
On this page
Code lists
A code list is a set of { code, label } values you can reuse. You use it for fixed choices, such as language, country, document type, or your organisation’s own categories. The code is the fixed value. Epistola stores it in data, and integrations send it. The label is the readable text authors see.
Choose the right value source
There are three ways to set which values an attribute allows:
- Free format — any value allowed — Use this when the values are open-ended.
- Inline values — listed below — A short list you keep directly on the attribute. Use this for a small set that belongs only to this attribute, such as
acmeandrocket. - Bound to code list — A list with a name. Several attributes can share it, or you maintain it from an external source. Use this for larger lists or lists managed centrally, such as BCP-47 languages or ISO country codes.
Create a code list
A code list belongs to a catalog. You need Content Author access to a catalog you can edit.
- Open All catalogs in the side nav, choose the catalog, and open Code lists in the side nav.
- Choose New code list.
- Enter a Display name. Epistola fills in the Slug: 3 to 64 characters, lowercase letters, numbers, and hyphens.
- Under Source, choose how you maintain the entries:
- Inline — Add each code and label with Add entry. Pickers show the entries in the order you add them.
- URL — Enter a Source URL that returns a JSON array of entries. Optional
sortOrdervalues control the order in pickers.
- Choose Create code list.
The source URL must use https: and point to a public address and a .json file. Epistola refuses other URLs. When the source changes, open the list and choose Refresh from source.
URL entries use this shape:
[
{ "code": "en-US", "label": "English (United States)", "sortOrder": 1 },
{ "code": "nl-NL", "label": "Dutch (Netherlands)", "sortOrder": 2 }
]
If a URL refresh fails, Epistola keeps the entries from the last time it worked, and records the error. So pickers keep working while you fix the source.
Bind a code list to an attribute
Open the catalog’s Attributes page and choose Edit on the attribute. Set its Value constraint to Bound to code list and pick the list. The picker groups the lists by catalog. Binding replaces the inline values; it does not merge them.
A list from a catalog yours does not use yet appears under Other catalogs (adds a dependency). If you choose it, your catalog starts to depend on that catalog. Epistola then reads the list as it is in the release of that catalog your catalog uses.
When you use the attribute on a variant, authors see the visible entries in a dropdown. If the code and label differ, the dropdown shows code — label. Integrations keep using the code.
Manage entries
Open the catalog’s Code lists page and open a list to review its entries. Inline entries keep the order in which you added them. A URL source can provide sortOrder values.
When you choose Hide on an entry, authors can no longer pick it for new choices. For variants that already have the code, it stays valid. That way you can phase out a value safely.
To review a hidden entry, use Show hidden entries. To show it again, choose Unhide.
Catalogs and sharing
A change to a code list goes into the catalog’s next release, together with the catalog’s templates and other resources. It reaches documents when you publish the catalog with Publish…. How that works is in From template to document.
The System catalog provides bcp-47, iso-639-1, and iso-3166-1-alpha2. Epistola supplies that catalog, so you can only read these lists.
You cannot delete a code list while an attribute is bound to it. First change the Value constraint of the attributes that use it.
Documentation
Guided tour
Exercises
Integration guides
Epistola is open source, not free of cost. The organisations that use it fund its development, through Epistola or an Official Partner. We are steward-owned: fair prices, no profit maximisation. How Epistola is funded →