> For the complete documentation index, see [llms.txt](https://doc.demarches-simplifiees.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/le-conditionnel.md).

# Le conditionnel

Vous pouvez conditionner vos champs en fonction des réponses des champs précédents.

Cela vous permet en tant qu’administrateur d’avoir un formulaire plus simple, plus concis, et qui cible mieux vos usagers.

C’est également un gain de temps pour les usagers car ils se focaliseront uniquement sur les questions qui les concernent.

Le conditionnel est activé automatiquement sur tous les formulaires.

Voici un exemple d’utilisation du conditionnel :

1\) Le premier champ : le conditionnel ne s’applique pas sur le premier champ. La conditionnalité s’affichera à partir du deuxième champ.

Pour que le conditionnel fonctionne, il faut que le champ précédant la question conditionnée soit de l'un des types suivants :

* Oui/Non
* Case à cocher seule
* Nombre décimal
* Nombre entier
* Choix simple
* Choix multiple
* Adresse
* Départements
* Communes
* Régions
* EPCI

Le conditionnel ne fonctionne pas sur tous les types de champs.

Voici un exemple en utilisant un champ oui/non

Le champ oui/non est le premier champ, il va permettre d’activer le conditionnel sur le deuxième champ.

<figure><img src="https://463284772-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L7_aKvpAJdAIEfxHudA%2Fuploads%2FVILuZQeIUQGCYnuW8agW%2FConditionnel%201.png?alt=media&amp;token=2fa26874-60bd-48b6-8822-0001999c5d50" alt=""><figcaption></figcaption></figure>

2\) Deuxième champ :

Nous souhaitons faire apparaître la deuxième question en fonction de la question précédente.

* Étape 1 : créer un nouveau champ avec les informations nécessaires
* Étape 2 : activer la logique conditionnelle : « cliquer pour activer »

<figure><img src="https://463284772-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L7_aKvpAJdAIEfxHudA%2Fuploads%2FzJK6ZYF9gqZKLQy7d0XF%2FConditionnel%202.png?alt=media&amp;token=3caa778c-4559-4bf2-a73d-72735b741a30" alt=""><figcaption></figcaption></figure>

Étape 3 : Sélectionner le champ cible (la question) que vous souhaitez conditionner ainsi que l’opérateur

<figure><img src="https://463284772-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L7_aKvpAJdAIEfxHudA%2Fuploads%2FTHjbWoA86qXdcmjw0kWm%2FConditionnel%203.png?alt=media&amp;token=196f74f5-1abb-404d-b799-f99d1564b90e" alt=""><figcaption></figcaption></figure>

Sélectionnez la valeur qui conditionne le champ (oui pour afficher la question, non pour ne pas l’afficher)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.demarches-simplifiees.fr/pour-aller-plus-loin/le-conditionnel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
