A hierarchical picklist is a static picklist that is linked to a parent picklist. Each child option belongs to a specific parent option, so the child dropdown only offers the values that fit the parent the submitter already picked. This is how you build cascading dropdowns from admin-curated lists (country then region, medium then source, category then subcategory).
When to use it
- A controlled vocabulary has a natural parent then child shape, and picking the parent should narrow the child.
- You want to manage the child options as their own list, separate from the parent.
- The values are admin-owned and fixed, not pulled from another taxonomy’s records.
How it works
You link two static picklists by settingparent_id on the child to the parent picklist’s id. The child is otherwise an ordinary static picklist, with one addition: every child option carries an ancestor_path.
ancestor_path is an ordered list of the parent option codes, from the top of the chain down to the immediate parent. A region option under the country us has ancestor_path: ["us"]. In a three-level list (category, subcategory, product), a product option under electronics then audio has ancestor_path: ["electronics", "audio"].
The cascade shows up at submission time through the dropdown field. The child field declares depends_on pointing at the parent field. As the submitter fills the form, the child dropdown offers only the options whose ancestor_path exactly equals the codes selected in the parent chain, in order. While any parent in the chain is empty, the child dropdown stays disabled.
For a list deeper than two levels, give each level its own picklist and chain the links: level 3’s parent_id points at level 2, whose parent_id points at level 1. Each level’s options carry the full ancestor_path from the root down.
Settings reference
A hierarchical picklist uses the same settings as any static picklist. These are the ones that make it hierarchical.| Setting | Required | Default | Description |
|---|---|---|---|
type | Yes | static | Always static. Hierarchy is created by parent_id, not a separate type. |
parent_id | Yes, to link the list | None | The id of the parent static picklist. Omit it and the list is flat. |
options | Yes | None | The child options. When parent_id is set, every option must include an ancestor_path. |
options[].ancestor_path | Yes on every child option | None | Ordered list of parent option codes, root to immediate parent. Each code must resolve to a real option along the parent chain. |
allow_additions | No | false | When true, submitters can propose a new code under the parent they have selected. See user-addable options. |
Worked example
TheCountries and Regions lists from the hierarchical picklists tutorial, where Regions is linked to Countries:
depends_on:
country = us, the region dropdown offers only california and new_york, the two options whose ancestor_path is ["us"]. The same shape wires UTM medium then UTM source in the tutorial, with allow_additions: true on the child so marketers can add a new source under the medium they chose.
Gotchas
- Codes are unique per parent, not globally. Two children of the same parent cannot share a code, but two children under different parents can.
othercan exist under bothemailandsocial. This is the most common point of confusion when building a hierarchical list. - Parent codes are effectively permanent. Children store the parent’s code in their
ancestor_path, not its ID. Renamingustousaon the parent leaves every child whose path starts withuswithout a matching parent, so those options stop appearing. Rename the parent’sdescriptionfreely, but treat its codes as fixed once children reference them. - Every child option needs a complete
ancestor_path. Omitting it on a linked list is rejected. The path must be the full chain from the root to the immediate parent, not just the immediate parent’s code. - An option pointing at a parent code that does not exist never shows. It simply never matches the parent selection, with no error to the submitter. Validate the list when you publish so dangling paths surface early.
- Multi-select is not available. A dropdown cannot turn on
multiplewhen its picklist is linked (has aparent_idor has children) or when the field usesdepends_on. Cascading depends on a single parent value. Use separate fields if you need to capture several values at one level. - For record-sourced cascading, use an automated picklist instead.
parent_idlinks two static lists. If your cascade should be driven by another taxonomy’s records, build an automated picklist with more than onelevel. It produces the same parent then child narrowing without hand-maintaining options.
Related
- Static picklist: the flat case. A hierarchical list is a static list with
parent_id. - Automated picklist: record-sourced lists, which support cascading through multiple levels.
- Records: the approved data behind automated picklists.
- Dropdown field: how
depends_onsets up the cascade from the field side. - Cascading dropdowns recipe: a hands-on walkthrough.
- Tutorial Part 5: Hierarchical picklists