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

# サーベイで条件付きロジックを作成する

> Widget Studio で条件付きロジックイベントを設定して、訪問者の回答に基づいてサーベイ要素や画面の表示/非表示を切り替えます。

サーベイとやり取りする際に訪問者が提供した値に基づいて、特定のアクションをトリガーできます。条件付きロジックを使うと、各ユーザーの入力に応じてサーベイ要素や画面を表示または非表示にできます。

## 訪問者のサーベイ回答に基づいて要素を表示/非表示する

サーベイ要素でユーザーが選択した内容や入力に基づいて要素や画面を表示(または非表示)するように構成できます。たとえば、訪問者が複数選択質問で特定の回答を選んだ場合、詳細を尋ねる Long Answer フィールドを表示できます。

これを行うには、次を作成します。

* **要素 1**、デフォルトで表示。
* **要素 2**、デフォルトで非表示。
* 要素 1 で特定の値が選択された場合に要素 2 を表示する **Events** セクションの条件付きルール。

### 使用例

マルチステップ NPS サーベイを構築し、ユーザーのスコアに基づいてエクスペリエンスをカスタマイズしたいとします。たとえば、ユーザーが 0 から 6 のスコア(Detractor)を付けた場合、追加のフィードバックを求めるフォローアップ質問を表示することができます。スコアが 7 から 10(Passive または Promoter)の場合、感謝メッセージに直接進むことができます。

次の例では、サーベイは 2 つの画面で構成されます。

* **画面 1:** NPS スコア質問(0-10)。
* **画面 1(Detractors のみ):** スコアの主な理由を尋ねるオープンテキストフィールド。
* **画面 2:** 確認画面(「Thank you for your feedback!」)。

#### ステップ 1: サーベイ画面を設定する

Widget Studio で両方の画面を作成します。

* NPS 要素を含む画面 1
* 確認メッセージを含む画面 2

<Frame>
  ![Screen 1](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/screenshot-2025-06-10-at-3.45.08PM-1536x960.png)
</Frame>

<Frame>
  ![Screen 2](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/screenshot-2025-06-10-at-3.44.05PM-1536x960.png)
</Frame>

画面 1 がデフォルトの画面であることを確認します。

#### ステップ 2: Detractors にフォローアップ質問をする

1. NPS 要素を選択します。
2. **Settings** タブの **Follow-up question** で **Detractors** を選択します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/screenshot-2025-06-10-at-3.46.55PM-1536x960.png)
</Frame>

#### ステップ 3: Passives と Promoters 用の条件付きロジックイベントを追加する

1. **Events** パネルに移動して **Add event** をクリックします。
2. トリガーとして **Survey/Form** を選択します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/trigger.png)
</Frame>

3. **By element survey/form value** を選択します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/survey-event.png)
</Frame>

4. **Select an element** > **NPS** をクリックします。
5. **Selected value** で **Passives** と **Promoters** を選択します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/passives-promoters-selected-1-1536x956.png)
</Frame>

6. 次に、アクションを定義します。**Add action** > **Show element** をクリックします。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/show-element-1.png)
</Frame>

7. **Thank you screen** を選択します。

<Frame>
  ![](https://storage.googleapis.com/kameleoon-storage-documentation/user-manual/images/assets/widgets/create-a-widget-with-the-widget-studio/create-csat-nps-and-surveys/create-conditional-logic-in-your-surveys/ty-screen-1-768x655.png)
</Frame>

8. 2 つ目のアクションを定義します: **Hide element** > **Screen 1**。

この設定により、訪問者が 7 から 10 のスコアを選択した場合に画面 2 が表示され、フィードバックから感謝画面へのスムーズな遷移が確保されます。

#### ステップ 4: ウィジェットをシミュレートする

最終的なロジックは次のようになります。

1. 画面 1 が常に最初に表示されます。
2. スコアが 0 から 6 の間の場合、フォローアップ質問が表示されます。
3. 訪問者が画面 1 で **Submit** をクリックすると、画面 2 に到達します。
4. スコアが 7 以上の場合、フォローアップ質問はスキップされ、ユーザーは直接画面 2 に進みます。

このロジックは、他のユーザーにとってエクスペリエンスを摩擦のないものに保ちつつ、Detractor からより詳細なインサイトを収集するのに役立ちます。
