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

# Logic, follow-ups and parameters

> Show questions conditionally, let AI ask follow-up questions on open-text answers, pass parameters through the survey link, and personalize question text.

> [!NOTE]
>
> Surveys is in **closed beta** and not yet available to all customers. [Join the waitlist](https://caplena.com/en/ai-survey-tool) to get access. See [Surveys overview](https://docs.caplena.com/surveys/overview.md) for current limitations.

## AI follow-up questions (probing)

Short or vague open-text answers are hard to analyze. With **probing**, the AI reads each answer and, when it helps, asks a short follow-up question, the way a good interviewer would. For example:

> **Q:** What's the one thing that would really make you want to shop with us again?\
>
> **Respondent:** Honestly just cheaper delivery. Paying shipping on small orders is annoying.\
>
> **Follow-up:** Which items or order sizes usually make the shipping cost feel hardest to justify?

Probing is available on **Open text** questions. The survey agent turns it on for the main "why" question by default.

![Probing settings on an open-text question](https://mintcdn.com/caplena-32172960/8VLjyD540Rp1inTq/images/surveys/probing.png?fit=max\&auto=format\&n=8VLjyD540Rp1inTq\&q=85\&s=f490deaf3c7e26ad5049a313ae5a1028)

To set it up, click **Probing** in the settings of an open-text question:

| Setting | Description |
| - | - |
| **Enable probing** | Turns AI follow-up questions on or off for this question. |
| **Max follow-ups** | The most follow-up questions the AI may ask, from 1 to 10 (default 2). The AI asks fewer, or none, when the answer is already clear. |
| **Prompt** | Optional instructions for the AI, for example "Focus on the delivery experience" or "Ask for a concrete example". You can insert earlier answers so the AI has context. Respondents never see it. |

Follow-up questions are asked in the respondent's language. On an optional question, respondents can skip a follow-up with **N/A**. On a required question, they answer follow-ups until the AI is done or the maximum is reached.

The full exchange is saved as one answer, as a short transcript:

```text wrap theme={null}
Agent: What's the one thing that would really make you want to shop with us again?
Respondent: Honestly just cheaper delivery. Paying shipping on small orders is annoying.
Agent: Which items or order sizes usually make the shipping cost feel hardest to justify?
Respondent: Small orders under 30 euros, like refills or a single T-shirt. 5.90 shipping on that feels like too much.
```

Topic analysis then runs on the whole exchange, so the extra detail ends up in your topics.

## Show if logic

Use **Show if** to show a question only to some respondents, for example to ask detractors what to improve.

![Show if condition on a question](https://mintcdn.com/caplena-32172960/8VLjyD540Rp1inTq/images/surveys/show-if.png?fit=max\&auto=format\&n=8VLjyD540Rp1inTq\&q=85\&s=0506f047b8336390e9243052afe7dbc5)

**The easiest way is to ask the agent**, for example "Only show this question to people who answered 1–3 on the likelihood question". It writes the condition for you.

To write a condition yourself, click **Show if** on the question:

1. Click the `{ }` button and pick the earlier question (or URL parameter) the condition depends on. It's inserted as a field, such as **Q3 answer**.
2. Type how to compare it, for example `<= 3`.

Common conditions:

| Show the question when… | Write |
| - | - |
| The answer to Q3 is 3 or lower | **Q3 answer** `<= 3` |
| The answer to Q3 is 9 or higher | **Q3 answer** `>= 9` |
| The respondent answered "Yes" to Q2 | **Q2 answer** `== true` |
| The respondent answered "No" to Q2 | **Q2 answer** `== false` |
| "Other" was among the options selected in Q1 | `"other" in` **Q1 answer** |
| The link contained `brand=acme` | **brand** `== "acme"` |

`==` means "is equal to", `!=` "is not equal to", and `<=` / `>=` "at most" / "at least". You can combine conditions with `and` / `or`, for example **Q3 answer** `<= 3 and` **Q2 answer** `== true`.

A question with a condition shows **Show if set**.

* Leave the field empty to always show the question.
* Conditions can only refer to **earlier** questions.
* If a condition refers to a question the respondent didn't answer (for example because it was hidden itself), the question is hidden too.
* The question list shows how many questions have logic, for example **12 Questions · 3 with logic**.

Respondents see "Question X of ~~Y" in the header. The "~~" is there because the total depends on their answers.

## URL parameters

**Parameters** let you pass extra information about a respondent through the survey link, such as their customer segment, a store ID or the campaign they came from. The respondent doesn't have to answer anything for it. You can then:

* store it alongside the response, for filtering and segmenting in your reports,
* use it in **Show if** conditions,
* insert it into question text.

![Defining URL parameters](https://mintcdn.com/caplena-32172960/8VLjyD540Rp1inTq/images/surveys/parameters.png?fit=max\&auto=format\&n=8VLjyD540Rp1inTq\&q=85\&s=b443ef54333b858331e91e1d9214b6b6)

### Set up parameters

**Step 1**

Click **Parameters** in the survey settings under the survey name (for example **0 parameters**).

**Step 2**

Click **Add parameter** and enter a **name**, for example `customer_segment`. Use only lowercase letters, numbers and underscores (`_`), starting with a letter.

**Step 3**

Choose what kind of value it holds: **Text**, **Numerical**, **Boolean** (yes/no) or **Date**. Each parameter is stored in its own column in your project.

To try the survey with example values, enter them under **Embedded parameters** in the **Test** section of the [Review](https://docs.caplena.com/surveys/review-and-publish.md#test-the-survey) step.

### Add parameters to the link

Add each parameter to the end of the survey link as `name=value`. Put a `?` before the first one and a `&` between them:

```text theme={null}
https://survey.caplena.com/s/<link-id>?customer_segment=lapsed&store=zurich
```

Here `<link-id>` stands for the code in your own survey link. Most email and CRM tools can fill in a different value for each contact automatically, for example with a merge field like `?customer_segment={{segment}}`.

* Only parameters defined in the survey are stored. Others are ignored.
* The values are saved when the respondent opens the survey and can't change afterwards.
* Don't use these names for your own parameters, because Caplena uses them in survey links: `rt` ([resume on another device](https://docs.caplena.com/surveys/share-and-collect.md#resuming-on-another-device)), `lang` ([survey language](https://docs.caplena.com/surveys/languages-and-translations.md#which-language-respondents-see)), `fresh` and `is_preview` (used for previews).

> [!WARNING]
>
> During the closed beta, use the **Text** type for all parameters, also for numbers. You can still use them in **Show if** conditions, for example **store** `== "zurich"`.

## Dynamic text in questions

You can insert earlier answers and parameters into question wording. While editing a question, use the `{ }` button to add a **previous answer** or a **URL parameter**. It appears as a field in the text.

> You gave us a **Q1 answer**. What's the one thing we could do to make it a 10?

The same fields can be used in the probing **Prompt**, so the AI knows what the respondent said earlier.

Respondents see the actual value. You can only insert answers from **earlier** questions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.