> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exoid.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Logic and conditions

> Show or skip a question with visibility conditions, and branch the interview with navigation rules.

Two different mechanisms decide what a respondent sees. A **visibility condition** decides whether a question appears at all. A **navigation rule** decides where the respondent goes after answering. You open both from the question panel of a block, and you can use them on the same block.

<Note>
  Conditions are built with the same interface everywhere in Exoid: on blocks, in the results filters and in quotas. Once you've learned it in one place, you know it in all three.
</Note>

## Visibility condition

The button on the block is labelled **Skip condition**, but the modal it opens is titled **Visibility condition** — "Show this question when the condition is met". At the top there is a **Show / Skip** selector, and it changes what the condition does:

* **Show** — the question appears only if the condition is true. Everyone else never sees it.
* **Skip** — the question is skipped when the condition is true, and shown to everyone else.

The two are mirror images. Pick whichever one lets you write the simpler condition and leave it at that.

### The elements of a condition

Every condition is made of three parts.

<ParamField path="Reference question" type="required">
  The question whose answer the condition evaluates. You pick it by question code.
</ParamField>

<ParamField path="Operator" type="required">
  The type of comparison to apply to that answer.
</ParamField>

<ParamField path="Value" type="required">
  The value to check for the condition to be true.
</ParamField>

### Stacking conditions and groups

One condition is often not enough. You can add more of them, joined by an operator.

| Operator | Behavior                             |
| -------- | ------------------------------------ |
| **AND**  | All the conditions must be true.     |
| **OR**   | At least one condition must be true. |

You can also nest **groups**: a group is a set of conditions evaluated together, which then counts as a single condition inside the level above it. That's how you write things like "(region is North OR region is Centre) AND age is over 35" without splitting the question in two.

<Tip>
  Build the groups before you add the outer conditions. Rearranging a long flat list into groups afterwards takes longer than starting from the structure you want.
</Tip>

## Navigation rules

**Navigation rules** are the branching feature. They open from the block into a modal titled **Edit logic for \<question code>**, and they say where the respondent goes once they've answered this block.

The modal offers two shapes.

<Steps>
  <Step title="Always go to">
    A single row: whatever the respondent answers, they go to the destination you pick. Use it to jump over a section or to send everyone to a specific ending screen.
  </Step>

  <Step title="A list of rules">
    Rows in the form `if <question> is <value> → <destination>`. Each row sends a different answer to a different place.
  </Step>

  <Step title="All other cases go to">
    The last row closes the list: it catches everyone that no rule above matched. Set it deliberately — it's the default path of the block.
  </Step>
</Steps>

### The order of the rules matters

Rules are evaluated from top to bottom and **the first one that matches wins**. The rules below it are never considered, even if they would also match.

You reorder the rules by dragging them. Put the most specific rule at the top and the broadest at the bottom: a wide rule sitting first will swallow all the traffic that should have gone to the ones after it.

## Which one do you need

<CardGroup cols={2}>
  <Card title="The question shouldn't be asked" icon="eye-off">
    Use a visibility condition. The respondent skips over the block and carries on in the normal flow.
  </Card>

  <Card title="The path has to change" icon="split">
    Use a navigation rule. The respondent answers, and the answer decides which block comes next.
  </Card>
</CardGroup>

Combining them on the same block is legitimate: the visibility condition decides whether the question is asked, the navigation rule decides where the answer leads.

## Next steps

<CardGroup cols={2}>
  <Card title="Context variables" icon="braces" href="/en/logic/variables">
    Store values from the URL or from an answer and reuse them across the interview.
  </Card>

  <Card title="Scripts" icon="code" href="/en/advanced/scripts">
    Run JavaScript on a block to set a variable from the answers already collected.
  </Card>

  <Card title="Block options" icon="sliders-horizontal" href="/en/builder/block-options">
    The question code every condition and rule refers to, plus the settings shared by all blocks.
  </Card>

  <Card title="Quotas" icon="chart-pie" href="/en/distribute/quotas">
    The same condition builder, used to cap how many people of a given profile can complete.
  </Card>
</CardGroup>


## Related topics

- [Advanced logic expressions](/en/logic/expressions.md)
- [Block options](/en/builder/block-options.md)
- [Troubleshooting](/en/troubleshooting.md)
