> 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/navigation/build-a-navigation-menu-from-a-picklist.md).

# Build a Navigation Menu from a Picklist

Turn the values of a picklist field, such as Case Status, into a navigation menu that stays in sync when an admin adds or renames a value.

A service agent reviews the cases of one account by status: New, On Hold, Escalated. The statuses already exist as the values of the Case **Status** field. A Navigation that reads them from the field shows one item per status, and when an admin adds a status in Setup, the menu shows it on the next run with no change to the flow.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FH8cYT9A0kGoUNSexe4v1%2Fbuild-a-navigation-menu-from-a-picklist-result.png?alt=media" alt="A horizontal navigation menu with three case statuses, New selected, then On Hold and Escalated"><figcaption><p>One item per selected value of the Case Status field.</p></figcaption></figure>

## Before you start

* A screen flow that receives the account Id in a text input variable `recordId`.
* The [Navigation](https://docs.avonnicomponents.com/flow/flow-components/navigation.md) reference, for the settings this page does not use.

## Steps

{% stepper %}
{% step %}

### Add the Navigation to the first screen

1. Drag **Avonni Navigation** onto the first screen and name it `CaseStatusMenu`.
2. Click **Open Component Builder**.
   {% endstep %}

{% step %}

### Point it at the Status field

1. In the **Properties** tab, set the data source to **Picklist**.
2. In **Object API Name**, choose **Case**.
3. In **Picklist Field**, choose **Status**.

The preview shows one item per value of the field.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FWt3kESehsme2wABGr5rj%2Fbuild-a-navigation-menu-from-a-picklist-panel.png?alt=media" alt="The Picklist data source settings with the Case object, the Status field and three selected values" width="320"><figcaption><p>The Picklist data source reads the values of Case Status.</p></figcaption></figure>
{% endstep %}

{% step %}

### Keep only the statuses the agent needs

* **Picklist Value**: select **New**, **On Hold** and **Escalated**. The agent has no use for Closed here. Leave the field empty to show every value.
* **Record Type**: if Case has record types, pick one to show only its values. The setting appears only on an object with record types.
* **Sort Order**: **Default Order of Field** keeps the order set in Setup, which for a status usually follows the case life cycle. **Ascending** and **Descending** sort the values instead.
  {% endstep %}

{% step %}

### Select a status when the screen opens

Set **Active Navigation Item Value** to `New`.

Each item takes the picklist label as its label and the picklist API name as its value. With the standard Case statuses both are the same, but on a translated or renamed value they differ: always type the API name, as shown on the field in Setup.
{% endstep %}

{% step %}

### Get the cases of the picked status

After the screen, add a **Get Records** element on **Case** with two conditions:

* **AccountId** Equals `{!recordId}`
* **Status** Equals `CaseStatusMenu` > **Active Navigation Item Value**

Show the result on the next screen, for example in a data table. To skip the **Next** button, add a **Select** interaction on the Navigation, set its **Type** to [Flow Navigation](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/flow-navigation.md) and the second **Type** to **Next Screen**: the flow moves on as soon as the agent picks a status.
{% endstep %}

{% step %}

### Save and test

Click **Done**, save the flow and run it with **Debug** and an account Id. The menu shows New, On Hold and Escalated, with New highlighted. Click **Escalated** (then **Next**, if you did not add the interaction): the next screen lists only the escalated cases of that account.

In Setup, add a status value to the Case **Status** field and run the flow again. If **Picklist Value** is empty, the new status appears in the menu. If you selected values, add the new one to **Picklist Value**.
{% endstep %}
{% endstepper %}

## Add a count or a disabled state per status

A Picklist source gives each item only a label and a value. It has no **Tag**, **Disabled** or sub items. To show "Escalated 3" or gray out a status with no cases, list the statuses as **Manual** items and compute the numbers in the flow.

|                                | **Picklist** data source | **Manual** items with the picklist values |
| ------------------------------ | ------------------------ | ----------------------------------------- |
| New status added in Setup      | Appears on its own       | Add it to the items by hand               |
| Count badge per status         | Not available            | **Tag** bound to a Number variable        |
| Status with no case grayed out | Not available            | **Disabled** bound to a Boolean formula   |

1. Before the screen, add a **Get Records** on **Case** where **AccountId** Equals `{!recordId}`, storing all records, named `Get_Account_Cases`.
2. Add one **Collection Filter** per status on `Get_Account_Cases`, for example `Escalated_Cases` with **Status** Equals `Escalated`.
3. Add an **Assignment**: `EscalatedCount` (a Number variable) **Equals Count** `{!Escalated_Cases}`. Do the same for New and On Hold.
4. Create a Boolean formula `NoEscalatedCase` with `{!EscalatedCount} = 0`.
5. In the Navigation, set the data source to **Manual** and add three items. Use the picklist API names as values: `New`, `On Hold`, `Escalated`.
6. On each item, set **Tag** to its count variable, for example `{!EscalatedCount}`. Under **Advanced Options**, set **Disabled** to its formula, for example `{!NoEscalatedCase}`.

The **Get Records** after the screen does not change: the values are still the picklist API names.

## Troubleshooting

<details>

<summary>No status is highlighted when the screen opens</summary>

**Active Navigation Item Value** holds the label instead of the API name, or a different case. Copy the API name from the field in Setup.

</details>

<details>

<summary>A status is missing from the menu</summary>

It is not selected in **Picklist Value**, or the selected **Record Type** does not include it.

</details>

<details>

<summary>The next screen shows no cases</summary>

The Get Records compares **Status** with a typed label instead of `CaseStatusMenu` > **Active Navigation Item Value**, or the account has no case in that status.

</details>

## Related tutorials

* [Build tabs on one screen](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/build-tabs-on-one-screen-with-navigation.md): show a section per status on the same screen instead of moving to the next one.
* [Reuse one menu across a multi-screen flow](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/reuse-one-menu-across-a-multi-screen-flow.md): route each item to its own screen and come back to the menu.
* [Add sub-menus and columns to a navigation menu](https://docs.avonnicomponents.com/flow/tutorials/components/navigation/add-sub-menus-and-columns-to-a-navigation-menu.md): group items under headings and columns.


---

# 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/navigation/build-a-navigation-menu-from-a-picklist.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.
