> For the complete documentation index, see [llms.txt](https://docs.dapta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dapta.ai/dforms/logic/branching.md).

# Branching & jumps

Route respondents through a dForms form with branching rules: If answer is rules that jump to a later question or skip to the end, the Always go to catch-all, first-match-wins evaluation, forward-only

Branching changes where a respondent goes after answering a question. Instead of always continuing to the next question, an answer can **jump to** a later question or **skip to end** of the form. Use it to send disqualified leads straight to the ending, or hot leads straight to the booking step, without them seeing the questions in between.

Conditions ([Show & hide conditions](/dforms/logic/conditions.md)) decide whether a question appears; branching decides where the answer leads. Both live in the same **Logic** dialog.

This page uses a form built from the **Lead qualifier** template, where the dropdown **What's your monthly budget?** carries two rules.

***

## Add a rule: If answer is… then…

**Step 1:** In the **Build** tab, select the question whose answers should route people (a **Single choice**, **Multiple choice** or **Dropdown** question). In the **Question settings** panel, click **Edit logic** on the **Logic** card, then scroll to **Where the answer leads**.

**Step 2:** Click **Add rule**. A rule has two parts: **If answer is** (pick one of the question's options) and **then** (pick the destination). The **then** list offers **→ skip to end** and **⚡ jump to {question}** for every question that comes *after* this one. On a **Slides** form it lists only the first question of each later screen, because a jump opens a whole screen. A question with no title is listed by its position, for example "Question 5".

<figure><img src="https://3835013762-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCy5rSNtQmtqYCGzJlNEB%2Fuploads%2Fgit-blob-b9cf5b1a2ad2d1c8ce29c540a689aa94ff3a78b2%2Fforms-branching-01-if-answer-is.png?alt=media" alt="The Where the answer leads section of the Logic dialog for What&#x27;s your monthly budget? with the Always go to control and a rule that reads If answer is Under $500 / month then skip to end"><figcaption><p>A rule under <strong>Where the answer leads</strong>: the lowest budget goes straight to the end. Further rules stack below it.</p></figcaption></figure>

**Step 3:** Add as many rules as you need and click **Done**. The Logic card now lists the rules as sentences (**If Under $500 / month → skip to end**, **If $2,000+ / month → How soon do you need this?**) and the question card in the list shows a **2 rules** badge. Click the **×** next to a rule (**Remove rule**) to delete it.

> **⚠️ Note:** Rules are evaluated **top to bottom and the first match wins**. The dialog says so right under the rules: **Rules run top to bottom; the first match wins. Anyone who doesn't match continues in order.** If two rules name the same option, only the upper one ever runs.

***

## Always go to: the catch-all

Every question has an **Always go to** control above its rules. It is the destination for everyone who does not match a rule, and the default is **Next question in order**. Open the dropdown to pick a later question or **End of the form**.

| Choice                     | What happens                                                                                                                                              |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Next question in order** | The default. Respondents continue down the list (hidden questions are skipped).                                                                           |
| A later question           | Everyone who answers jumps to that question, whatever they picked. On the canvas the line is labeled **any answer** (or **any booking** for a Scheduler). |
| **End of the form**        | Answering this question ends the form for everyone. Use it for the last question of a branch.                                                             |

Questions without answer values (Message, Reveal screen, Short text and so on) cannot carry **If answer is** rules; they only have the **Always go to** control. A **Scheduler** question has its own **After a booking** section that works the same way.

> **💡 Tip:** To disqualify a respondent on a specific answer, a rule **then → skip to end** is enough. To end the form after a question for *everyone*, use **Always go to → End of the form**, or the **Ends the form** switch in the question's **Advanced settings**, under **Behavior** (its hint reads **Completing this question ends the form immediately (disqualification).**).

***

## Rules to remember

* **Forward only.** A jump can only target a question that comes later in the list, so the **then** list never offers earlier questions. This prevents loops: a respondent can never be sent back.
* **Skipped questions stay unanswered.** They are not shown, they are not required, and they add no points to the score.
* **Skipping to the end does not skip the score.** A respondent sent to the end still lands on the outcome that matches their score so far, or on the form's own ending if no range matches. See [Outcomes](/dforms/logic/outcomes.md).
* **Hidden targets cancel the jump.** If the target question is hidden for this respondent by its own **Show when** / **Hide when** rules, the jump is ignored and they simply continue in order. The exception is a target that shares a screen with other questions: the jump still opens that screen, at its first visible question.
* **Deleting a target question** leaves the rule in place, but it no longer has anywhere to go, so it is ignored and the respondent continues in order. Delete the rule too, or point it at another question. Reordering keeps rules working, as long as the target is still after the source.
* **Field keys follow you.** Renaming a question's **Field key** updates the rules that reference it.

***

## Jumps on a screen of several questions

On a **Slides** form you can [group questions on one screen](/dforms/builder/screens.md). Each question keeps its own rules, but they run when the respondent leaves the screen:

* **The jump waits for the screen.** The respondent answers every question on the screen and clicks the button; only then does a jump or a skip to the end happen. The Logic dialog, the **Logic** card and the **Branching** dialog say so: **This jump happens when the respondent leaves this screen.**
* **Top to bottom, first jump wins.** The rules of the screen's questions are read from the top of the screen down, and the first one that goes somewhere wins. An **Always go to** on an upper question therefore wins over the rules of the questions below it.
* **A jump opens a whole screen.** A target in the middle of another screen lands on that screen's first visible question. The **then** list only offers the first question of each screen, so you see the note **This jump lands mid-screen, so it opens the whole screen.** only on a rule written before its target was grouped.
* **A jump inside its own screen does nothing.** A rule that points at a later question of the same screen is ignored, and the form continues in order. The editor flags it: **This jump points inside its own screen, so it is ignored and the form continues in order.**
* **Ends the form** on a question of the screen ends the form when the respondent submits the screen.

***

## Review every rule: the Branching dialog

Instead of opening each question one by one, open the **Logic** tab and click **Branching** above the canvas. The dialog lists **every question in order** with its **Always go to** control, its **If answer is** rules and its **Show when** / **Hide when** conditions, and the summary line tells you how much logic the form carries (**3 of 8 questions carry logic.**, or **No question carries logic yet. Everyone walks the same path.**).

<figure><img src="https://3835013762-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCy5rSNtQmtqYCGzJlNEB%2Fuploads%2Fgit-blob-c34c4649e642f731161fe3b5ee1827db870fc773%2Fforms-branching-02-branching-dialog.png?alt=media" alt="The form-wide Branching dialog listing every question with its Always go to dropdown and conditions, with the summary line highlighted"><figcaption><p>The <strong>Branching</strong> dialog: all routing and visibility controls for the whole form, editable in place.</p></figcaption></figure>

Everything in this dialog is editable: change a destination, add a rule or pick a **Show when** field right there. Click **Done** when you are finished. Changes are autosaved like any other edit; publish the form to make them live.

***

## See the branches: the Logic canvas

The **Logic** tab draws the whole flow. Cards run left to right in question order; a solid line is the normal path and a **dashed line is a jump**, labeled with the answer that triggers it. Jumps that skip to the end all land on the shared **END** marker.

<figure><img src="https://3835013762-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCy5rSNtQmtqYCGzJlNEB%2Fuploads%2Fgit-blob-c000e7616fef7fae34765a6d5b66ddae6052fc4a%2Fforms-branching-03-canvas-branch.png?alt=media" alt="The Logic canvas zoomed on the budget question: a dashed line labeled $2,000+ / month jumps to a later card, and a dashed line labeled Under $500 / month goes to the END marker"><figcaption><p>Both rules drawn: one jump to a later question, one skip to <strong>END</strong>.</p></figcaption></figure>

* **Hover a card** and click its edit button (tooltip **Edit the logic for {question}**) to open the Logic dialog for that question.
* **Drag a card** to move it out of the way when lines overlap (for example to see a jump that passes behind another card). Your positions are remembered with the form.
* **Auto-arrange** puts every card back on the automatic grid. **Fit to screen** zooms so the whole flow is visible; **Zoom in** / **Zoom out** change the level of detail (titles and line labels appear as you zoom in).
* On a narrow window the canvas becomes the read-only **Logic map**, where jumps are written as **If {answer} → {question}** and **If {answer} → skip to end**.

## What's next

* [Show & hide conditions](/dforms/logic/conditions.md): show a question only when an earlier answer calls for it.
* [Scoring](/dforms/logic/scoring.md): the points a skipped question never adds.
* [Outcomes (results by score range)](/dforms/logic/outcomes.md): where respondents land after **skip to end**.
* [Content steps: Message, Reveal screen, Scheduler](/dforms/builder/question-types/content-steps.md): the **After a booking** routing of a Scheduler question.


---

# 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.dapta.ai/dforms/logic/branching.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.
