---
title: Conditional logic
description: Show or hide questions and answer choices based on what respondents answer.
icon: git-branch
search:
  keywords: [logic, show hide, conditions, skip logic, display logic, if then]
---

Conditional logic shows or hides parts of your form depending on earlier answers. For example, only ask for a company name when someone selects _I'm buying for a business_.

## Open the logic editor

Select a question and press <kbd>⌘</kbd> <kbd>⇧</kbd> <kbd>L</kbd>, or press `/` and choose **Conditional logic**. The editor has four sections:

| Section | What it does |
| --- | --- |
| **Question display** | Show or hide a block. |
| **Hide answer choices** | Hide some options of a choice question. |
| **Branching** | Send respondents to a different page. See [Branching and page jumps](/logic/branching-and-page-jumps). |
| **Calculations** | Change a [calculated field](/blocks/calculated-fields). See [Calculations and scoring](/logic/calculations-and-scoring). |

![The conditional logic editor](/blume-assets/content/docs/logic/images/logic-editor.png)

## Show or hide a question

1. **Choose the block**

    In **Question display**, pick the block to show or hide.

2. **Set the condition**

    Under **When**, choose a question, an operator and a value. For example,
    *Customer type* **Is** *Business*.

3. **Choose the action**

    Pick **Show** or **Hide**. A block set to **Show this block** stays hidden
    until the condition matches.

Add more conditions and choose whether **all** or **any** of them must match.

## Operators

| Answer type | Operators |
| --- | --- |
| Text, email, phone, link | **Is**, **Is not**, **Contains**, **Does not contain**, **Is empty**, **Is not empty** |
| Multiple choice, dropdown | **is**, **is not**, **Is empty**, **Is not empty** |
| Checkboxes, multi-select, ranking | **is**, **is not**, **Contains**, **Does not contain**, **Is empty**, **Is not empty** |
| Numbers, ratings, scales | **Is**, **Is not**, **Greater than**, **At least**, **Less than**, **At most**, **Is empty**, **Is not empty** |
| Dates and times | **Is**, **Is not**, **After**, **On or after**, **Before**, **On or before**, **Is empty**, **Is not empty** |

## Hide answer choices

Use **Hide answer choices** to remove options that don't apply. For example, hide _Express delivery_ when the country isn't _United States_.

:::tip[Test your logic] Click **Preview** and try different answers. Logic works in preview exactly as it will for respondents. :::

## Write logic as a formula

For more complex rules, open **Edit formula** to write logic like a spreadsheet formula:

```text
if(answer("Age") >= 18 and not empty(answer("Email")), show_question("Newsletter"))
```

See the [formula reference](/logic/formula-reference) for every function.

**[Branching and page jumps](/logic/branching-and-page-jumps)**

Skip pages based on answers.

**[Calculations and scoring](/logic/calculations-and-scoring)**

Keep a score or a total.
