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

# Sub-steps and Step Actions

Build a vertical Progress Indicator with sub-steps and action buttons, then read which button the user clicked to route the flow.

A new customer's onboarding has a Contacts step that is really two jobs: the primary contact and the billing contact. On a vertical Progress Indicator, each can be its own sub-step under Contacts. An action button adds a shortcut: an **Edit** button on Account details lets the agent reopen that screen from anywhere in the flow.

This page builds a vertical indicator with sub-steps and actions, and uses the **Step Action Click** outputs to decide what happens next.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FZqKcHE93AtnktwTvnngP%2Fprogress-indicator-sub-steps-and-step-actions-result.png?alt=media" alt="Vertical progress indicator with two sub-steps under Contacts and an Edit button on Account details" width="320"><figcaption><p>Contacts holds two sub-steps, and Account details carries an Edit button.</p></figcaption></figure>

## Before you start

* A screen flow using the shared onboarding steps: `Account details`, `Contacts`, `Products`, `Review`, `Submit` (values `account`, `contacts`, `products`, `review`, `submit`).
* Sub-steps and actions exist only on the **Vertical** and **Vertical Navigation** types. The Steps editor shows their fields only while **Type** is set to one of these two.
* To route the flow from a button, a router Decision and a Current Step variable. [Clickable steps with a router](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/clickable-steps-with-router.md) sets them up.

## Steps

{% stepper %}
{% step %}

### Set the type to Vertical

In the screen editor, select the Progress Indicator. In its **Properties** tab, set **Type** to **Vertical**.

Steps with several lines of content or with buttons read better with **Icon Alignment** set to **Top** (in the **Step Icon** section).
{% endstep %}

{% step %}

### Add the sub-steps under Contacts

Open the **Contacts** step in the Steps list. Under **Sub Steps**, add two entries:

| Label           | Value              |
| --------------- | ------------------ |
| Primary contact | `contacts-primary` |
| Billing contact | `contacts-billing` |

A sub-step has its own **Label** and **Value**, and can be hidden or greyed out with **Hide Step** and **Disable Step**. Keep every value unique across steps and sub-steps.

Sub-steps show only while Contacts or one of its sub-steps is the current step. On any other step, Contacts stays collapsed to one line.
{% endstep %}

{% step %}

### Point Current Step at a sub-step

**Current Step** accepts a sub-step value as well as a step value. On the screen where the agent enters the billing contact, set **Current Step** to `contacts-billing`: the indicator opens Contacts and highlights Billing contact.
{% endstep %}

{% step %}

### Add the action buttons

Open the **Account details** step. Under **Actions**, add one action:

* **Label**: `Edit`
* **Name**: `edit`. This is what the flow receives when the button is clicked.
* **Icon Name**: `utility:edit` (optional).

An action needs a **Name** and either a **Label** or an **Icon Name**, otherwise it is not shown. Sub-steps take actions the same way.

With several actions on one step, **Visible Action Buttons** sets how many show as buttons; the others move to a menu. **Hide Actions** and **Disable Actions** hide or grey out all the actions of the step at once.
{% endstep %}

{% step %}

### React to the button

1. Open the **Interactions** tab and add an interaction under **Step Action Click**.
2. Set **Type** to **Flow Navigation**, then the second **Type** to **Next Screen**.
3. Leave **Target Name** empty to react to every button, or pick one button in the list.

After the screen, the Progress Indicator fills three outputs:

| Output                             | What it holds                                                                                  |
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
| **Clicked Step Action Name**       | The **Name** of the button, here `edit`.                                                       |
| **Clicked Step Action Step Value** | The value of the step or sub-step that holds the button, here `account`.                       |
| **Clicked Step Action Step**       | The record behind the step, when the steps come from a **Query** data source. Empty otherwise. |

Add a Decision after the screen with an outcome **Edit account** when **Clicked Step Action Name** **Equals** `edit`. In that outcome, assign `account` to your Current Step variable and connect it to the router.
{% endstep %}

{% step %}

### Save and test

Run the flow and move to the Products screen.

* The indicator shows five steps, with Primary contact and Billing contact nested under Contacts.
* An **Edit** button sits to the right of Account details.
* Click **Edit**: the flow leaves Products and opens the Account details screen.
  {% endstep %}
  {% endstepper %}

## Troubleshooting

<details>

<summary>The Sub Steps and Actions fields are missing</summary>

The Steps editor shows them only while **Type** is **Vertical** or **Vertical Navigation**. Set the type first, then reopen the step.

</details>

<details>

<summary>An action button does not appear</summary>

Check that the action has a **Name**, and a **Label** or an **Icon Name**. Check also that **Hidden** is off on the action and **Hide Actions** is off on its step.

</details>

<details>

<summary>Clicking a step with sub-steps returns a sub-step value</summary>

When the user clicks a step that has sub-steps, **Clicked Step Value** returns the value of its first sub-step that is neither hidden nor disabled: clicking Contacts returns `contacts-primary`. Give the router an outcome for each sub-step value, or test for both values in the Contacts outcome.

</details>

## Related tutorials

* [Clickable steps with a router](https://docs.avonnicomponents.com/flow/tutorials/components/progress-indicator/clickable-steps-with-router.md): the router this page sends the flow back to.
* [Business quote with a vertical Progress Indicator](https://docs.avonnicomponents.com/flow/tutorials/projects/business-quote-with-vertical-progress-indicator.md): a full quote flow on a vertical indicator.
* [New Progress Indicator Step Collection](https://docs.avonnicomponents.com/flow/actions/ui-and-navigation/new-progress-indicator-step-collection.md): build steps, sub-steps and actions in a flow action instead of the editor.


---

# 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/sub-steps-and-step-actions.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.
