> 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/progress-indicator/steps-from-a-picklist.md). Agents can also search and read this documentation through its [MCP server](https://docs.avonnicomponents.com/~gitbook/mcp).

# Steps from a Picklist

Show an Opportunity's stages as a path in a screen flow, read from the Stage picklist, with the current stage taken from what the record actually saved.

A sales rep opens a flow from an Opportunity to move the deal to its next stage. The path at the top of the screen lists the stages straight from the **Stage** picklist, so a stage an admin adds later shows up without touching the flow. The highlighted stage always comes from the saved record, so the path never claims a stage change that Salesforce refused.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FRqlxoCUo7XsmQwh3YeQ6%2Fprogress-indicator-steps-from-a-picklist-result.png?alt=media" alt="Opportunity stage path with Needs Analysis current, two completed stages before it and the later stages up to Closed Won"><figcaption><p>Stages read from the Stage picklist, current stage from the record.</p></figcaption></figure>

## Before you start

* A screen flow launched from an Opportunity record page, with a Text input variable `recordId` (select **Available for input**).
* The [Progress Indicator](https://docs.avonnicomponents.com/flow/flow-components/progress-indicator.md) reference page and the [Picklist data source](https://docs.avonnicomponents.com/flow/component-builder/data-sources/picklist.md) page, for the settings not used here.

## Steps

{% stepper %}
{% step %}

### Get the Opportunity

Add a **Get Records** element named `Get_Opportunity`: object **Opportunity**, condition **Id** equals `{!recordId}`, first record only.

The path reads its current stage from this record, not from anything the rep picks on the screen.
{% endstep %}

{% step %}

### Add the path and read its steps from Stage

1. Add a screen named **Update Stage** and drop the **Avonni Progress Indicator** on it.
2. In the **Properties** tab, set **Type** to **Path**.
3. Set **Data Source** to **Picklist**, **Object API Name** to `Opportunity` (required), then **Picklist Field** to **Stage**.
4. In **Picklist Value**, select the stages to show. Leave **Closed Lost** out: it is an outcome, not a step on the way.
5. Keep **Sort Order** on **Default Order of Field**, so the stages follow the order set in Setup.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fce8Zo1RpM6ifSlre7vDc%2Fprogress-indicator-steps-from-a-picklist-data-source.png?alt=media" alt="Progress Indicator properties with Type Path and the Picklist data source on the Opportunity Stage field, nine stages selected" width="480"><figcaption><p>The Picklist data source on Opportunity Stage.</p></figcaption></figure>

Each stage becomes a step. Its label is the stage label and its value is the stage API value.
{% endstep %}

{% step %}

### Take the current step from the record

1. Set **Current Step** to `{!Get_Opportunity.StageName}`.
2. Keep **Format** on **Linear**: the stages before the current one show as completed.

Because the value comes from the record, it is the stage API value, which is exactly what the steps carry. A hand-typed label would not match in an org that translates its picklists.
{% endstep %}

{% step %}

### Let the rep pick the new stage

On the same screen, add a standard **Picklist** component named `New_Stage`, with a **Picklist Choice Set** on Opportunity **Stage**.

Do not connect `New_Stage` to **Current Step**. The path moves only once the record has changed.
{% endstep %}

{% step %}

### Save the stage, then read it back

1. After the screen, add an **Update Records** element on `{!Get_Opportunity}` that sets **Stage** to `{!New_Stage}`.
2. After it, add a **Get Records** element named `Get_Saved_Opportunity` with the same condition as step 1.
3. Add a screen named **Stage Saved** with a Progress Indicator set up as in step 2, and **Current Step** set to `{!Get_Saved_Opportunity.StageName}`.

Reading the record again shows what Salesforce kept, including a change made by another automation on save.
{% endstep %}

{% step %}

### Handle a refused save

A validation rule can reject the new stage. Give the Update Records element a **Fault** connector to a screen named **Stage Not Saved**:

1. Add a Progress Indicator set up as in step 2, with **Current Step** still `{!Get_Opportunity.StageName}`.
2. Turn on **Has Error**: the current stage shows in an error state.
3. Add a **Display Text** with `{!$Flow.FaultMessage}` so the rep reads why.

The path stays on the stage the record still holds. [Error handling](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/error-handling.md) covers the error display in detail.
{% endstep %}

{% step %}

### Save and test

Add the flow to the Opportunity record page and open a deal in **Needs Analysis**.

* The path shows every stage of the picklist, with **Needs Analysis** current. The two stages before it show a check mark instead of their name.
* Pick **Value Proposition** and click **Next**: **Stage Saved** shows **Value Proposition** as current.
* Pick a stage a validation rule blocks: **Stage Not Saved** keeps **Needs Analysis** current, in error, with the rule's message.
  {% endstep %}
  {% endstepper %}

{% hint style="warning" %}
If you turn on **Enable click for each steps** so reps can click a stage, the highlight moves to the clicked stage as soon as it is clicked, before anything is saved. Treat **Clicked Step Value** as a request: send it to the Update Records element and show the stage read back from the record, as above.
{% endhint %}

## Troubleshooting

<details>

<summary>A closed deal shows Prospecting as current</summary>

The record holds a stage that **Picklist Value** leaves out, such as **Closed Lost**. When **Current Step** matches no step, the indicator falls back to the first stage as current and shows none as completed. Add the stage to **Picklist Value**, or send closed deals down another branch with a Decision.

</details>

<details>

<summary>The path shows stages that this sales process does not use</summary>

The picklist returns every active value. Narrow it with **Picklist Value**, or set **Record Type** so the path shows only the stages of that record type.

</details>

<details>

<summary>The path moved, but the record did not change</summary>

**Current Step** is connected to something other than the saved record: the rep's choice, or a clicked step. Set it from a Get Records that runs after the save, as in step 5.

</details>

## Related tutorials

* [Creating a Universal Dynamic Progress Step Collection](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/creating-a-universal-dynamic-progress-step-collection.md): when the steps are your own screens, not a picklist.
* [Clickable steps with a router](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/clickable-steps-with-router.md): read the clicked step and route the flow with a Decision.
* [Error handling](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/error-handling.md): **Has Error** and **Error Steps** side by side.
* [Pick a type and drive it from a variable](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/how-to-change-the-appearance-of-your-progress-indicator-using-a-variable.md): pick another Type than Path.


---

# 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/progress-indicator/steps-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.
