# Add logic (https://www.getfounderhq.com/docs/journeys/add-logic)

Two tools make a Journey respond to its answers. Routing rules choose the
next screen. Calculated values turn answers into new numbers and words.

## Send people to different screens

By default a screen leads to the next one in order. A rule changes that.

1. Select the screen that asks the question.
2. In the Inspector, open **Navigation** and find **Next screen**.
3. Press **Add rule**.
4. Fill in the rule: **If the answer** to which question, the
   **Condition**, the **Value**, and the screen to **Go to**.
5. Set **Otherwise go to** for everyone no rule matches. It starts as
   **Next in order**.

A rule reads like this: if `team_size` is `solo`, go to the solo plan
screen.

### Conditions

| Condition | True when |
| --- | --- |
| **Is** | The answer equals the value |
| **Is not** | The answer is anything else |
| **Includes** | A multi-select answer contains the value |
| **Has an answer** | The person answered |
| **Has no answer** | The person skipped it |

### Several rules

The first rule that is true decides the next screen. Drag the rules to
set their order, and put the most specific one first.

A rule can use any earlier answer, not only the one on its own screen.

### See every path

Switch the preview to **Flow canvas**. It draws each screen and the paths
between them. Click a path to see the rule behind it.

## Show a block only for some people

A block on an info page has the same conditions. Open the block, find
**Show when**, and choose **On a condition**. Use this to show one result
to one group and another to the rest.

## Compute a value

A calculated value is a formula over the answers: a score, a price, a
recommendation.

1. Open the **Variables** tab.
2. Press **Add calculated value**.
3. Give it a **Name**, such as `score`.
4. Write the **Formula**. The names you can use are listed below the box.

A formula is a JavaScript expression:

```js
(daily_users > 100 ? 2 : 1) + (has_team === "yes" ? 1 : 0)
```

**Result now** shows what the formula gives for the answers in the
preview. A formula can use answers and the calculated values above it.

Use a calculated value like an answer: in a rule, in a **Show when**
condition, or in text as `${score}`.

## Verify

Answer the questions in the preview in different ways. Check that each
set of answers reaches the right screen, and that **Result now** changes
as you expect.
