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

# Clickable Steps with a Router

Turn the Progress Indicator into a menu, so a user can click any step and jump straight to that screen of a multi-screen flow.

An onboarding agent walks a new customer through five screens: Account details, Contacts, Products, Review and Submit. On the Review screen the customer spots a typo in the account name. Instead of pressing Previous three times, the agent clicks **Account details** on the Progress Indicator and lands on that screen.

This page builds that behavior: every step is clickable, the click sends the flow forward, and a Decision element (the router) opens the screen that matches the clicked step.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FVAbhM0keaDxb6zu4FTyq%2Fprogress-indicator-clickable-steps-with-router-result.png?alt=media" alt="Horizontal progress indicator with five onboarding steps, Products current, the first two completed" width="480"><figcaption><p>The onboarding steps, with Products as the current step.</p></figcaption></figure>

## Before you start

* A screen flow with one screen per step. This page uses the shared onboarding steps: `Account details`, `Contacts`, `Products`, `Review`, `Submit`, with the values `account`, `contacts`, `products`, `review`, `submit`.
* The same steps on every Progress Indicator. Typing them once per screen works; to keep them in one place, build them once with [a universal step collection](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/creating-a-universal-dynamic-progress-step-collection.md).
* The [Progress Indicator reference](https://docs.avonnicomponents.com/flow/flow-components/progress-indicator.md) for the settings not covered here.

## Steps

{% stepper %}
{% step %}

### Create the Current Step variable

The router reads this variable to decide which screen to open.

1. In Flow Builder, open the **Toolbox** and select **New Resource**.
2. Set **Resource Type** to **Variable**, **API Name** to `varCurrentStep`, **Data Type** to **Text**.
3. Set **Default Value** to `account`, so the flow starts on the first screen.
   {% endstep %}

{% step %}

### Add the router Decision

Place a Decision element right after **Start** and name it `Router`. Add one outcome per step:

| Outcome         | Condition                                 |
| --------------- | ----------------------------------------- |
| Account details | `{!varCurrentStep}` **Equals** `account`  |
| Contacts        | `{!varCurrentStep}` **Equals** `contacts` |
| Products        | `{!varCurrentStep}` **Equals** `products` |
| Review          | `{!varCurrentStep}` **Equals** `review`   |
| Submit          | `{!varCurrentStep}` **Equals** `submit`   |

Connect each outcome to its screen.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F8a5qaKqn0WqCCA8EZQJm%2Fprogress-indicator-clickable-steps-with-router-decision.png?alt=media" alt="Flow Builder Decision editor with five outcomes, the Contacts outcome testing varCurrentStep equals contacts"><figcaption><p>The router Decision, one outcome per step.</p></figcaption></figure>
{% endstep %}

{% step %}

### Make the steps clickable on each screen

On each of the five screens, add the Progress Indicator and set, in its **Properties** tab:

* **Current Step**: mapped to `{!varCurrentStep}`.
* **Enable click for each steps**: on.
* The five steps, with the values listed above.

**Enable click for each steps** is available for the Horizontal, Vertical, Path and Vertical Navigation types. Bar and Circle cannot be clicked. On Horizontal, the user clicks the step marker: the label text under it is not clickable.
{% endstep %}

{% step %}

### Send the flow forward on a click

A click alone changes nothing on screen: the flow has to move on so the router can run.

1. Open the Progress Indicator's **Interactions** tab.
2. Under **Step Click**, add an interaction.
3. Set **Type** to **Flow Navigation**, then the second **Type** to **Next Screen**.
4. Leave **Target Name** empty. The interaction then runs for every step.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FozfMyEuMqmoUsiHxgCXh%2Fprogress-indicator-clickable-steps-with-router-interaction.png?alt=media" alt="Interactions tab with a Step Click interaction of type Flow Navigation set to Next Screen, Target Name empty" width="480"><figcaption><p>A click on any step moves the flow to the router.</p></figcaption></figure>

Repeat on every screen. The [Flow Navigation](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/flow-navigation.md) page lists the other navigation types.
{% endstep %}

{% step %}

### Store the clicked step, then loop back to the router

After the click, the component's **Clicked Step Value** output holds the value of the step the user clicked. When the user presses the footer **Next** button instead, it is empty, so give each screen a fallback.

1. Create a formula resource per screen, **Data Type** **Text**. For the Account details screen (its Progress Indicator is named `PI_Account`):

   `BLANKVALUE({!PI_Account.clickedStepValue}, "contacts")`

   The fallback is the value of the next step: `"products"` after Contacts, `"review"` after Products, and so on.
2. After the screen, add an Assignment: `{!varCurrentStep}` **Equals** that formula.
3. Connect the Assignment back to the `Router` Decision.

The Submit screen does not loop back: connect it to the element that saves the record.
{% endstep %}

{% step %}

### Save and test

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

* The flow opens on Account details, with Account details as the current step.
* Press **Next**: the Contacts screen opens.
* On Contacts, click the **Products** step marker (the dot, not the label text): the Products screen opens and Products becomes the current step.
* Click the **Account details** marker: you go back to the first screen without passing through Contacts.
* There, click **Next** without touching the indicator: the flow goes on to Contacts, as usual. An earlier click is not replayed.

Test both paths on every screen: a click on a step, and the footer **Next** without a click.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
With **Format** set to **Linear** (the default), going back to Account details shows the later steps as not done yet. To keep them marked, set **Format** to **Non Linear** and list the visited steps in **Completed Steps**. [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) compares the two formats.
{% endhint %}

## Troubleshooting

<details>

<summary>Clicking a step does nothing</summary>

Check these in order:

* **Enable click for each steps** is off, and the **Step Click** interaction is missing. A step is clickable when either one is set.
* The **Type** is Bar or Circle. These types have no clickable steps.
* The step is **Disabled**. A disabled step ignores clicks.
* The step is clickable but there is no **Flow Navigation** interaction, so the flow never leaves the screen.

</details>

<details>

<summary>The flow always goes back to the same screen</summary>

The router only sees `{!varCurrentStep}`. If no Assignment writes the clicked value into it after the screen, the variable keeps its old value. Check that each screen is followed by its Assignment, and that the Assignment uses the formula of that screen (it names that screen's Progress Indicator).

</details>

<details>

<summary>The current step does not match the screen</summary>

**Current Step** must match a step **Value**, not its **Label**: `contacts`, not `Contacts`. Check the Decision outcomes use the same values.

</details>

## Related tutorials

* [Creating navigational screen flows in Router mode](https://docs.avonnicomponents.com/flow/tutorials/projects/creating-navigational-screen-flows-in-router-mode.md): the full three-screen project this pattern comes from.
* [Business quote with a vertical Progress Indicator](https://docs.avonnicomponents.com/flow/tutorials/projects/business-quote-with-vertical-progress-indicator.md): the same router with Previous and Next buttons on a vertical indicator.
* [Sub-steps and step actions](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/sub-steps-and-step-actions.md): buttons inside the steps, and the outputs they fill.
* [A universal step collection](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/creating-a-universal-dynamic-progress-step-collection.md): define the five steps once for every 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/progress-indicator/clickable-steps-with-router.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.
