> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/components/combobox/implement-dependent-picklists-in-comboboxes.md).

# Implement Dependent Picklists in Comboboxes

Show only the reason details that fit the case reason an agent picks, and keep the detail field locked until a reason is chosen.

A support agent logging a case picks a reason, then a more precise detail. The detail list should only offer what fits that reason, and the agent should not be able to fill it first. Two Avonni Comboboxes handle both: the second one reads the first one's value to filter its options, and stays disabled until that value exists.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FBXTVgXhL6OJ1UDNsjsvq%2Fcombobox-implement-dependent-picklists-in-comboboxes-result-v2.png?alt=media" alt="Two comboboxes: Case Reason set to New problem, and Reason Detail open with only three matching details" width="540"><figcaption><p>Reason Detail lists only the details that fit the selected reason.</p></figcaption></figure>

## Before you start

* A dependent picklist pair defined in Setup (**Object Manager**, your object, **Fields & Relationships**, **Field Dependencies**). In this example, a custom Case picklist **Reason Detail** depends on the standard **Case Reason** field.
* A screen flow with one screen for both comboboxes.
* The [Combobox](https://docs.avonnicomponents.com/flow/flow-components/combobox.md) reference page, for every property this tutorial does not touch.

## Steps

{% stepper %}
{% step %}

### Add the Case Reason combobox

1. Drag an **Avonni Combobox** onto the screen. Set its API Name to `Case_Reason`: the second combobox and the formula below refer to it by that name.
2. Open the Component Builder and set **Label** to `Case Reason`.
3. In the **Data Source** section, select **Picklist**.
4. Set **Object API Name** to `Case` and **Picklist Field** to `Reason`.
5. Optional: pick a **Sort Order** (**Ascending**, **Descending** or **Default Order of Field**) and turn on **Required**.

If the object has record types, a **Record Type** field also appears. Pick one to show only the values available for that record type.
{% endstep %}

{% step %}

### Add the Reason Detail combobox and link it

1. Drag a second **Avonni Combobox** below the first one. Set its API Name to `Reason_Detail` and its **Label** to `Reason Detail`.
2. In **Data Source**, select **Picklist**, set **Object API Name** to `Case` and **Picklist Field** to the dependent field, Reason Detail.
3. A **Controlling Value** field appears under **Picklist Value**. It opens on a resource search: find `Case_Reason` and select its **Value** output. Once picked, the field shows only **Value**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FT5yCbjFBsiTzO0RaOrkm%2Fcombobox-implement-dependent-picklists-in-comboboxes-panel.png?alt=media" alt="Data Source section of the Reason Detail combobox with Picklist selected and Controlling Value set to the Case Reason value" width="320"><figcaption><p>Controlling Value points to the Case Reason combobox's Value.</p></figcaption></figure>

The combobox now keeps only the Reason Detail values that the field dependency allows for the selected reason. If you make Case Reason multi-select, Reason Detail lists the details allowed for any of the selected reasons.
{% endstep %}

{% step %}

### Keep Reason Detail disabled until a reason is picked

While **Controlling Value** is empty, the combobox applies no filter and lists every Reason Detail value. Disabling it until a reason exists keeps the agent from picking a detail that does not match.

1. In the Flow Builder **Toolbox**, click **New Resource** and select **Formula**.
2. Set the API Name to `NoReasonSelected` and the **Data Type** to **Boolean**.
3. Enter the formula `ISBLANK({!Case_Reason.value})`. It returns `true` while Case Reason is empty.
4. Back in the Reason Detail combobox, set **Disabled** to the `NoReasonSelected` resource instead of a fixed value.

To wait for several fields, combine them in the same formula, for example `OR(ISBLANK({!Case_Reason.value}), ISBLANK({!Case_Priority.value}))`.
{% endstep %}

{% step %}

### Save and test

Save the flow and click **Debug** or **Run**.

* On load, Reason Detail is greyed out and cannot be opened.
* Pick `New problem` in Case Reason: Reason Detail becomes active and lists only the details defined for that reason.
* Pick another reason: the Reason Detail list changes to match it.
* Clear Case Reason with its clear icon: Reason Detail is disabled again.
  {% endstep %}
  {% endstepper %}

## Troubleshooting

<details>

<summary>The Controlling Value field does not appear</summary>

It appears only when the selected **Picklist Field** has a controlling field. Check that you selected the dependent field (Reason Detail), not the controlling one, and that the dependency exists in **Field Dependencies** for that object.

</details>

<details>

<summary>Reason Detail lists every value, whatever the reason</summary>

**Controlling Value** is empty or points to the wrong resource. Select the first combobox (`Case_Reason`) and its **Value** output, not a text you typed. Until a reason is selected, every value shows by design: that is what the disabled step prevents.

</details>

<details>

<summary>Reason Detail shows no options after a reason is picked</summary>

The selected reason has no Reason Detail value included in the field dependency, or the values are not available for the **Record Type** you selected. Open **Field Dependencies** and include at least one value for that reason.

</details>

<details>

<summary>Reason Detail never gets disabled, or never gets enabled</summary>

* Never disabled: **Disabled** holds a fixed value instead of the `NoReasonSelected` resource.
* Never enabled: the formula is inverted (`NOT(ISBLANK(...))`), its **Data Type** is not **Boolean**, or it refers to another component than `Case_Reason`. Copy the API Name from the first combobox exactly.

</details>

## Related tutorials

* [Filter Data Tables with Multi-Select Comboboxes](https://docs.avonnicomponents.com/flow/tutorials/components/combobox/filter-data-tables-with-multi-select-comboboxes.md): use what the agent picked to filter a table.
* [Build a Reactive Data Table Using Dependent Picklists](https://docs.avonnicomponents.com/flow/tutorials/reactive-query-tutorials/build-a-reactive-data-table-using-dependent-picklists.md): the same pair of comboboxes driving a Data Table query.
* [Use a Combobox Selection in a Query or Flow](https://docs.avonnicomponents.com/flow/tutorials/components/combobox/use-a-combobox-selection-in-a-query-or-flow.md): pass the selected reason to a Get Records, a subflow or a record update.
* [Keep Combobox Selections When Users Go Back](https://docs.avonnicomponents.com/flow/tutorials/components/combobox/keep-combobox-selections-when-users-go-back.md): keep both values when the agent returns to this screen.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/tutorials/components/combobox/implement-dependent-picklists-in-comboboxes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
