# Navigational Screen Flows in Router Mode

## Overview <a href="#overview" id="overview"></a>

This tutorial demonstrates how to build a multi-screen flow with custom content for each screen using the [Avonni Progress Indicator](https://app.gitbook.com/s/1FUd4apB9YHgCEMUFbVb/flow-components/progress-indicator) component in router mode. Before starting, you'll need to [install the Avonni Components managed package](https://appexchange.salesforce.com/listingDetail?listingId=a0N4V00000IDsfbUAD) in your Salesforce org.

We'll guide you through adding steps to the progress indicator and configuring navigation between screens using routers and assignment elements. By the end of this tutorial, you can create a smooth and intuitive user experience within your flow using the Avonni Progress Indicator.

Let's begin!

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FO7re7fs3IPndxQdHpeLT%252F2023-02-10_10-54-29.png%3Falt%3Dmedia%26token%3D5c0f32b4-6a6f-4d00-8380-407cb025a8a8&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=988cd798&#x26;sv=2" alt=""><figcaption><p>Flow Builder preview of the Horizontal Progress Indicator with router</p></figcaption></figure>

## Result <a href="#result" id="result"></a>

The final result displays a progress indicator that can be clicked to navigate from one screen to another.

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FPAdTgjM7Yx8uqEGr1W9W%252F2023-02-10_12-01-25%2520%281%29.gif%3Falt%3Dmedia%26token%3De073648c-aa4d-46c8-921e-4dd3a51b0d1c&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1f54db60&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## Guided Video Tutorial <a href="#guided-video-tutorial" id="guided-video-tutorial"></a>

[**Watch Tim Combridge's guided video tutorial**](https://www.linkedin.com/posts/tim-combridge_avonni-salesforce-salesforceflow-activity-7207245371687792640-N_BU)

Tim Combridge demonstrates how to create a user-friendly progress indicator within Salesforce Flow using router navigation.

![](https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FsuI4bbhuaSR4bgHdO81D%252F2024-06-21_11-37-54.png%3Falt%3Dmedia%26token%3D59ecd22c-f9c6-4b0e-8d09-f4f00448e3c1\&width=300\&dpr=4\&quality=100\&sign=d938a226\&sv=2)

## Guided Steps <a href="#guided-steps" id="guided-steps"></a>

### 1️⃣ Create the Current Step Variable <a href="#id-1-create-the-current-step-variable" id="id-1-create-the-current-step-variable"></a>

We first need to set up a variable called "Current Step" in our Salesforce flow. Think of this variable as a tracker—it’s like a note that keeps track of the user is current step as they move through the flow. By storing and updating this value, we can control what the user sees and where they go next. Here’s how to set it up:

* **Data Type**: Choose "Text" because we’ll use simple labels (like "step1", "step2", etc.) to represent each step.
* **Default Value**: Set it to "step1" so the flow knows to start at the first step when it begins.

This variable is the foundation of our progress indicator—it helps the flow remember where the user is and ensures the navigation works smoothly. Let’s create it and move forward.

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FuNyGii4LbrnQyeBbqwRH%252F2023-02-10_16-15-42.png%3Falt%3Dmedia%26token%3De2b7c1f7-ca23-41c9-aac4-bf2a5aaca7ac&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=223e8184&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### 2️⃣ Create the progress type variable <a href="#id-2-create-the-progress-type-variable" id="id-2-create-the-progress-type-variable"></a>

In this step, we create the progress type variable, as we need to use the same value multiple times to define the default variant for the progress indicator. This can make your flow more efficient and easier to maintain.

* **Data Type** > Text
* **Default Value** > Horizontal

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FbMnawycj6zj1a1RSHDTw%252F2023-02-10_16-19-46.png%3Falt%3Dmedia%26token%3D9bafe09b-b67a-465c-a99f-2184f4e48d74&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=7df94aed&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### 3️⃣ Router decision configuration <a href="#id-3-router-decision-configuration" id="id-3-router-decision-configuration"></a>

Next, we’ll add a "Router Decision" to our Salesforce flow. This acts like a guide, directing users to the right screen based on the step they click in the progress indicator. It makes the indicator interactive—users pick a step, and the router takes them to the matching stage.&#x20;

**Why?** It uses the "Current Step" variable to decide what happens next, keeping the flow smooth and functional. Here’s how to set it up in the steps below.

**Setup**: For the "Navigate to Screen 1" decision, we’ll use the "Current Step" variable (set up in [Step 1](#id-1-create-the-current-step-variable)). We’ll configure it to check if the variable equals "step1". If it does, the flow knows to take the user to Screen 1. Here’s how this works: when a user clicks "Step 1" in the progress indicator, the router matches it to "step1" and directs them to the right spot.&#x20;

Next, we’ll repeat this process for the other steps—like "step2" for Screen 2—ensuring each click on the progress indicator takes the user exactly where they need to go. This ties everything together, making navigation seamless.

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fi2Pfse2717TkN0IKBD9s%252F2023-02-10_16-16-29.png%3Falt%3Dmedia%26token%3D2822397c-46ab-4d29-96f7-b38c3f82f4f4&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ae128549&#x26;sv=2" alt=""><figcaption><p>Router Screen to navigate to screen 1</p></figcaption></figure>

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FRITrHJebevWmDOZw1jF5%252F2023-02-10_16-16-58.png%3Falt%3Dmedia%26token%3D40f58568-1af0-4ee3-9fb4-89790c459e0e&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=7243337a&#x26;sv=2" alt=""><figcaption><p>Router Screen to navigate to screen 2</p></figcaption></figure>

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252F78zB1ocBeaG8yNI14TN5%252F2023-02-14_15-06-21.png%3Falt%3Dmedia%26token%3Db2a87e51-2985-4066-a012-f2a04a2ae1f1&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=653184c7&#x26;sv=2" alt=""><figcaption><p>Router Screen to navigate to screen 3</p></figcaption></figure>

### 4️⃣ Create Screen 1 <a href="#id-4-create-screen-1" id="id-4-create-screen-1"></a>

For screen 1, add the Progress Indicator component with the following settings:

* **Type** > Progress Type (the variable created [in step 1](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#1.-create-the-current-step-variable), accessible using the Mapped menu)
* **Current Step** > Current Step (the variable created [in step 2](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#2.-create-the-progress-type-variable), accessible using the Mapped menu)

Then, we can add any other component to that screen.

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FCHsqPtsBsXY963bvhNcX%252F2023-02-10_16-50-43.png%3Falt%3Dmedia%26token%3Ddecd7ad0-aa7e-460f-9edf-e1b143d7ead4&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=5b7a5235&#x26;sv=2" alt=""><figcaption></figcaption></figure>

#### Set Up the "Next Screen" Interaction

From the Progress Indicator element, we need to create a next-screen interaction. This will ensure your flow will go to the next screen when pressing a step click.

* Open the Component Builder from the Progress Indicator component.
* Open the **Interactions tab**
* Type > **Flow Navigation**
* Type > **Next Screen**

{% hint style="warning" %}
Don't select an option from the "Target Name" attribute. Leave this blank and complete the interaction as shown below.
{% endhint %}

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fm7HFZDgeNCfrI0n5pWuL%252F2023-03-10_15-40-24.png%3Falt%3Dmedia%26token%3D288d02f2-c6b2-4f2e-bb30-12b776a65086&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=523adec8&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**Assignment for screen 1**

Assignments are practical for assigning values to variables or fields within a flow. By creating assignments, you can ensure that the data processed in your flow is accurate and consistent. Here, we are using an assignment to assign a default value related to the current step in screen 1.

Creating an assignment with the following settings:

* **Variable**: currentStep (we created that variable [here](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#1.-create-the-current-step-variable))
* **Operator**: Equal
* **Value**: {!ProgressIndicator\_Screen1.clickedStepValue}

This ensures the flow knows which step is active, keeping the navigation smooth and accurate.

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252F0DQpAd13Uxb9UDiNyLfs%252F2023-02-14_15-08-47.png%3Falt%3Dmedia%26token%3D2ec46b81-f89e-4da2-9a5e-292768938592&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=784485c5&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### 5️⃣ Create Screen 2 <a href="#id-5-create-screen-2" id="id-5-create-screen-2"></a>

For screen 2, add the Progress Indicator component with the following settings:

* **Type** > Progress Type (the variable created [in step 1](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#1.-create-the-current-step-variable))
* **Current Step** > Current Step (the variable created [in step 2](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#2.-create-the-progress-type-variable))

Then, we can add any other component to that screen.

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FMkGynjgRDORBOiyJsO4n%252F2023-02-10_16-51-15.png%3Falt%3Dmedia%26token%3Ddf0bea7f-7f9e-4527-abe9-95e6093adbc6&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=f83b7c&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**Create the Next Screen interaction**

From the Progress Indicator element, we need to create a next-screen interaction. This will ensure your flow will go to the next screen when pressing a step click.

* Open the Component Builder from the Progress Indicator component
* Open the **Interactions tab**
* Type > **Flow Navigation**
* Type > **Next Screen**

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fm7HFZDgeNCfrI0n5pWuL%252F2023-03-10_15-40-24.png%3Falt%3Dmedia%26token%3D288d02f2-c6b2-4f2e-bb30-12b776a65086&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=523adec8&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**Assignment for screen 2**

You can go ahead and reproduce the same steps we did for the [assignment for screen 1](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#assignment-for-screen-1).

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252F0FQK38hhJjsMbFbGbmPU%252F2023-02-14_15-09-16.png%3Falt%3Dmedia%26token%3Dd421e728-78bb-4a6e-8de1-de2e68fe63f4&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=e4bdc34a&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### 6️⃣ Create Screen 3 <a href="#id-6-create-screen-3" id="id-6-create-screen-3"></a>

For screen 3, add the Progress Indicator component with the following settings:

* **Type** > Progress Type (the variable created [in step 1](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#1.-create-the-current-step-variable))
* **Current Step** > Current Step (the variable created [in step 2](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#2.-create-the-progress-type-variable))

Then, we can add any other component to that screen.

**Create the Next Screen interaction**

From the Progress Indicator element, we need to create a next-screen interaction. This will ensure your flow will go to the next screen when pressing a step click.

* Open the Component Builder from the Progress Indicator component
* Open the **Interactions tab**
* Type > **Flow Navigation**
* Type > **Next Screen**

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fm7HFZDgeNCfrI0n5pWuL%252F2023-03-10_15-40-24.png%3Falt%3Dmedia%26token%3D288d02f2-c6b2-4f2e-bb30-12b776a65086&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=523adec8&#x26;sv=2" alt=""><figcaption></figcaption></figure>

**Assignment for screen 3**

You can go ahead and reproduce the same steps we did for the [assignment for screen 1](https://docs.avonnicomponents.com/tutorials/projects/creating-navigational-screen-flows-in-router-mode#assignment-for-screen-1).

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FEoC3nSnBDkcLOB4SogF1%252F2023-02-14_15-09-42.png%3Falt%3Dmedia%26token%3Dafe910b2-3008-4508-86c2-de460aac9470&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ae140d80&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### 7️⃣ Create the connection to the Router Screen <a href="#id-7-create-the-connection-to-the-router-screen" id="id-7-create-the-connection-to-the-router-screen"></a>

We need to link our flow back to the "Router Decision" screen we set up earlier. This connection is key to keeping navigation smooth and seamless for users. By looping back to the router, the flow can check the "Current Step" variable and guide users to the right screen whenever they click a step in the progress indicator.&#x20;

We’ll also connect the other screens (like Screen 2, Screen 3, etc.) similarly. This ensures users can move between steps easily, without getting lost or stuck. These connections tie everything together, making the flow intuitive and user-friendly!

<figure><img src="https://docs.avonnicomponents.com/~gitbook/image?url=https%3A%2F%2F27923732-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FA0iB4b2MamU0gR2z0qc1%252F2023-03-10_15-42-53%2520%281%29.gif%3Falt%3Dmedia%26token%3Ddb62da63-9fdd-4d3e-a2a4-045a7c836061&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=777a3ed6&#x26;sv=2" alt=""><figcaption></figcaption></figure>
