# Nested Wizard Workflow

This workflow demonstrates how to display the Nested Wizard's pages as a sub-navigation within the Parent Wizard, allowing users to seamlessly navigate between sections. By integrating a Nested Wizard, users can interact with multi-step forms within a larger parent form structure. This approach enhances user experience by organizing complex workflows into manageable steps while maintaining a clear and structured navigation flow.

{% hint style="info" %}
By default, the [**Wizard Form**](https://app.gitbook.com/s/6LdEf8SjBIeQDsRL3BdV/form-types#wizard) utilizes the [**Panel** ](https://app.gitbook.com/s/6LdEf8SjBIeQDsRL3BdV/components/layout-components#panel)component as the UI for the Wizard Navigation Pages. When a new Wizard page is created within the Form Builder, a Panel will be added to the form to represent the fields and content of that page.&#x20;
{% endhint %}

## The Problem

At times, you may want to add a Nested Wizard page to a Parent Wizard form to add more granular control over user navigation between sections. Here is an example Wizard Form that will be used as a Nested Form inside a Parent Wizard.&#x20;

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2Ftc6AGlxgSVfejNgDLsI3%2FChildwizard.jpg?alt=media&#x26;token=58115b9c-b764-47e2-a9fb-0949496ea142" alt=""><figcaption></figcaption></figure>

When a Nested Wizard form is introduced into a Parent Wizard form, the Nested Wizard pages will be added to the Parent Wizard navigation bar.

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2Fvf4ZRoFXoFgjIaJ7Ll7v%2Fchildwizardpages.jpg?alt=media&#x26;token=e889e0bb-e4c8-4ae3-83bf-1f7cf238582f" alt=""><figcaption></figcaption></figure>

In most cases, this interface is not ideal, as users typically prefer the Nested Wizard navigation pages to be separate, functioning as a sub-UI within the Parent Wizard page, as shown below.

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2F2tQtvtpE0gaKwgLCs7sT%2Fsubnavigation.jpg?alt=media&#x26;token=39d5fa58-7c44-4489-8e9f-b7a0a840c9a2" alt=""><figcaption></figcaption></figure>

## Solution

This example will showcase how to utilize a layout component, liken the [**Panel** ](https://app.gitbook.com/s/6LdEf8SjBIeQDsRL3BdV/components/layout-components#panel)component to improve the wizard page navigation UI.&#x20;

{% embed url="<https://www.loom.com/share/a24d281530c24f0f97a2ad0a3b96084e>" %}

### Create Child Wizard

Create a Wizard form that will be included in the Parent Wizard.

1. Navigate to a Project and create a new **Form**.
2. Click the **Display as Form** and select **Wizard**.&#x20;

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FJTJezY5S6EaCSypSeA9j%2Fformtype.jpg?alt=media&#x26;token=9778f2b3-9f2c-406b-82f4-66ef422ab82c" alt=""><figcaption></figcaption></figure>

3. Create **Wizard Pages** by clicking the **+Page** button
4. Add fields to the **Wizard** pages

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FMsWb7K72jlM8rx0q6gtk%2Fchildwizard1.jpg?alt=media&#x26;token=9211fe70-1030-482a-aff8-fd4536700288" alt=""><figcaption></figcaption></figure>

### Create Parent Wizard

A parent form will be needed to house the Nested Wizard pages.&#x20;

1. Create a new **Form**
2. Click the **Display as Form** and select **Wizard**.&#x20;
3. Create **Wizard Pages** by clicking the **+Page** button

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FwnRqgLfj3EFNpsa5oWym%2Fparentwizard.jpg?alt=media&#x26;token=05c8d80e-14fd-41c2-add6-394221442ef8" alt=""><figcaption></figcaption></figure>

4. Add a **Panel** component to the page of the Parent Wizard a Nested Wizard should be added to.&#x20;

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FeXyoUzmHulvNxcu2ue4U%2Fpanel.jpg?alt=media&#x26;token=8da00c03-3abc-4c6f-8477-bc2b066fc274" alt=""><figcaption></figcaption></figure>

5. Check the **Hide Label** within the Panel settings to remove the Panel title from the form.

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FrVLH9ic8AQSb1LCujuZa%2Fhidelabel.jpg?alt=media&#x26;token=28bc4e1c-4c7f-4541-8219-e796206deda4" alt=""><figcaption></figcaption></figure>

6. Add the **Nested Form** inside the Container component

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2F7KbHG8mJ11p3J5tS34sH%2Fnestedform.jpg?alt=media&#x26;token=99806e5b-fedb-497a-a133-4b3e2dc18f70" alt=""><figcaption></figcaption></figure>

7. Click the **Form** dropdown and select the **Child Form**
8. **Save** the Form

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FZQVnMRDYOqra9hZYvLSb%2Fselectnesteform.jpg?alt=media&#x26;token=27aa82bb-c7f2-4a27-925a-88b4d0fdc417" alt=""><figcaption></figcaption></figure>

9. **Use** the Form to confirm the UI is working as expected.&#x20;

{% hint style="info" %}
The Nested Form inside the Container should present its own wizard pages separately, positioned beneath the Parent Wizard's navigation bar.
{% endhint %}

<figure><img src="https://2053155777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdE1To8ypyE1yhXEJ7QlD%2Fuploads%2FUNHpuJh3zvPEQyLiYZmK%2Fapplicationgif.gif?alt=media&#x26;token=432122cc-5c33-4757-9c31-e91883154ec9" alt=""><figcaption></figcaption></figure>

## Things To Consider

* Wizard button labels (Cancel, Previous, Next) and functionality can be customized to enhance the user experience.\
  [**Custom Wizard**](https://formio.github.io/formio.js/app/examples/customwizard.html)[ **Documentation**](https://formio.github.io/formio.js/app/examples/customwizard.html)
* If Wizard navigation is not needed, consider using the [**Tab** ](https://app.gitbook.com/s/6LdEf8SjBIeQDsRL3BdV/components/layout-components#tabs)component as an alternative.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.form.io/how/nested-form-workflows/nested-wizard-workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
