> For the complete documentation index, see [llms.txt](https://help.gleantap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.gleantap.com/forms/multi-step-forms.md).

# Multi-Step Forms

**1st form:**&#x20;

The first step needs to have a field to identify the user (such as 'email'). Add any other data fields you'd like to collect on the first step. Then, be sure to select the 'Redirect URL' option and paste in the link to the second step (you may need to save this form and come back and edit it once you've made the second form). **At the end of the URL, add** <mark style="background-color:orange;">?email={email}</mark> **to ensure the email address is passed along to the next step.**

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FULiuQY3dJvD6T8bL8tW3%2FScreenshot%202024-01-30%20at%202.50.13%20PM.png?alt=media&amp;token=643a9e5f-661e-4198-bee8-2eba931507d8" alt=""><figcaption></figcaption></figure>

### 2nd form:

Like the first step, add the 'email' field and any other data fields you'd like to collect on the second step. Then, be sure to select the 'Redirect URL' option and paste in the link to the third step (you may need to save this form and come back and edit it once you've made the third form). **At the end of the URL, add** <mark style="background-color:orange;">?email={email}</mark> **to ensure the email address is passed along to the next step.**

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FMI6bD4kkjdFi9KAD1gXK%2FScreenshot%202024-01-30%20at%204.22.42%20PM.png?alt=media&amp;token=27cdd2ac-376b-4b17-be86-ea756a0a4f2f" alt=""><figcaption></figcaption></figure>

After you have saved your second form, click on the 'Customize Design' option for the form. On the screen that appears, we'll want to add some code to ensure that the 'email' field box becomes hidden and gets filled with the email address passed along from the first step.&#x20;

**Additional CSS box:**  <mark style="background-color:purple;">.field-email{ display:none; }</mark>

**Tracking code (inside \<head>) box:**  <mark style="background-color:purple;">const queryString = window\.location.search; const urlParams = new URLSearchParams(queryString); const email = urlParams.get('email'); window\.onload = function() { document.getElementById('email').value = email; }</mark>

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2F6voSajHKTs7mcUpJU2G6%2FScreenshot%202024-01-30%20at%202.44.50%20PM.png?alt=media&amp;token=b32a36e5-d195-42dc-a47e-8db92a88731f" alt=""><figcaption></figcaption></figure>

### 3rd form:&#x20;

Like before, add the 'email' field and any other data fields you'd like to collect on the third step. Since this is the final step, select the 'Confirmation Message' option.

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FP8xuKxwbzIh9hiKqtwsW%2FScreenshot%202024-01-30%20at%204.33.47%20PM.png?alt=media&amp;token=4c704634-c1bb-4b94-aa53-509ea33e3027" alt=""><figcaption></figcaption></figure>

After you have saved your third form, click on the 'Customize Design' option for the form. On the screen that appears, we'll want to add some code to ensure that the 'email' field box becomes hidden and gets filled with the email address passed along from the first step.&#x20;

**Additional CSS box:**  <mark style="background-color:purple;">.field-email{ display:none; }</mark>

**Tracking code (inside \<head>) box:**  <mark style="background-color:purple;">const queryString = window\.location.search; const urlParams = new URLSearchParams(queryString); const email = urlParams.get('email'); window\.onload = function() { document.getElementById('email').value = email; }</mark>

If you'd like the page to refresh after 7 seconds to the first step upon submission, add this additional piece of code - *be sure to replace INSERTURLHERE with the URL to the first form!!*&#x20;

**Tracking code (on form submission) box:** <mark style="background-color:red;">setTimeout(() => { window\.location.href = 'INSERTURLHERE' }, "7000");</mark>

<figure><img src="https://312952119-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaFKpjLzPT7iDAWD0tQXo%2Fuploads%2FBqRAJzRRtbpNRSWQ2R82%2Fscreencapture-app2-gleantap-form-form-design-6585613169eddc46e93baca3-65b95176fb4dfb4ddb1e5025-2024-01-30-16_41_47.png?alt=media&amp;token=a8087984-9daf-4fb3-ab20-3b58aee7c244" alt=""><figcaption></figcaption></figure>


---

# 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://help.gleantap.com/forms/multi-step-forms.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.
