---
title: Surveys
description: Ask for launch inputs and use earlier answers to show related questions.
---

Open a template's **Survey** tab. The map shows visibility conditions and the list gives you an ordered view of questions. Select **Edit survey** to change the survey. **Visual** and **YAML** edit the same draft. Use **Preview launch** to test branches without starting a job.

## Write a conditional survey

```yaml
pages:
  - title: Deployment
    questions:
      - variable: platform
        label: Where should the server run?
        type: choice
        required: true
        choices:
          - { value: aws, label: AWS }
          - { value: vmware, label: VMware }
  - title: AWS
    when: platform == "aws"
    questions:
      - variable: region
        type: choice
        choices: [eu-central-1, us-east-1]
        default: eu-central-1
  - title: VMware
    when: platform == "vmware"
    questions:
      - variable: datastore
        label: Datastore
        required: true
```

For a single page, you can start with `questions:` instead of `pages:`. Use ordinary Ansible variable names. Glodrik reserves names beginning with `ansible_` and `glodrik_`.

| Key | Where it applies | What it controls |
| --- | --- | --- |
| `title`, `description` | Page | Heading and guidance shown at launch. |
| `variable`, `label`, `help` | Question | Variable name and text shown to the user. |
| `type` | Question | `text`, `textarea`, `password`, `integer`, `float`, `boolean`, `choice`, or `multichoice`. The default is `text`. |
| `required`, `default` | Question | Whether an answer is needed and what value is filled in. Passwords cannot have a default. |
| `min`, `max`, `pattern` | Question | Bounds for supported types and a whole-value text pattern. |
| `choices` | Choice questions | Values, or objects with `value`, `label`, and optional `when`. |
| `when` | Page, question, choice | Whether it is visible based on earlier answers. |

Conditions support comparisons, `and`, `or`, `not`, `in`, `not in`, `is defined`, `is not defined`, and parentheses. Use earlier, non-password answers. Write booleans as `true` or `false`. Filters and function calls are unavailable.

Hidden questions contribute no survey answer. Visible answers override template extra variables of the same name. Two simultaneously visible questions cannot set the same variable. Password answers are stored encrypted and enter the playbook as variables. Keep them out of explicit task output.
