> For the complete documentation index, see [llms.txt](https://mind-expression-docs.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mind-expression-docs.gitbook.io/home/how-to-guides/build-q-and-a-subjects/case-2.-data-plans.md).

# Case 2. Data Plans

### Before you begin

This tutorial requires a webhook setup. Add a test webhook URL `http://mock-webhook.mind.ai` to your webhook settings.

### Add a Subject

1\. Click **Add Subject** on the Scope details page.

2\. Stay in the `Q&A` tab.

3\. Enter a Subject name.

4\. Enter Query Statement which is the expected customer query as "I want to see the mobile plans."

5\. Click **Recognize Statement** to get the Recognition Result.

<figure><img src="https://2637928320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiRqPwZJVepiA6JYXHnaO%2Fuploads%2FFHn3vBJJ6CdRl7A4uo1j%2Fimage.png?alt=media&amp;token=947193c4-c88c-4f4b-8492-60f2e6c37143" alt=""><figcaption></figcaption></figure>

6\. The **Recommended Statement** is the statement which is semantically related to more ontologies and can generally capture more statement structures with the same intent. To use the recommended statement, just tick the checkbox saying **Use Recommended Statement**.

7\. Click **Submit**.

8\. **Additional Query Statement to Recognize** may also be added but not required. This is used in case of multiple intents being expected to trigger this subject.

9\. Click **Add**.

### Build the Subject

1. Click **Add Action** in the Conversation panel.
2. Under AI Response, Click **Show response**.
3. Select the `Webhook` tab.

<figure><img src="https://2637928320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiRqPwZJVepiA6JYXHnaO%2Fuploads%2F9aM2N3KIrvBYOMuscYb6%2Fimage.png?alt=media&amp;token=34eae9b9-4df2-4c77-b75f-b4f0f610e44f" alt=""><figcaption></figcaption></figure>

4\. Choose a webhook URL `http://mock-webhook.mind.ai` to use from the dropdown and enter URL Parameter (domain path and/or query string) as `tutorial/mobile-plan-list?code=200`

**Webhook URL (Method: GET)**

**BASE URL** `http://mock-webhook.mind.ai`

\*\*URL PARAMETER `` **` `` tutorial/mobile-plan-list?code=200\`

\*\*\*\*

**Response Body**

```
{
 "plan-list": [
  {
   "plan-id": "10000002"
   "name": "4G+ data 25 plan"
   "amount": "$22"
   "data": "25G limited"
   "comment": "Speed will be reduced when exceeded maximum usage (25G)"
  }
  {
   "plan-id": "11000003",
   "name": "4G+ data 35 plan",
   "amount": "$28",
   "data": "35G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (35G)"
  },
  {
   "plan-id": "12000004",
   "name": "4G+ data 60 plan",
   "amount": "$35",
   "data": "60G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (60G)"
  },
  {
   "plan-id": "13000005",
   "name": "5G data 180 plan",
   "amount": "$48",
   "data": "180G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (180G)"
  },
  {
   "plan-id": "14000006",
   "name": "5G+ data 220 plan",
   "amount": "$50",
   "data": "220G limited",
   "comment": "Speed will be reduced when exceeded maximum usage (220G)"
  }
 ]
}
```

5\. \*\*\*\* Stay with the `GET` request method.

6\. Select an error message display method as `Template` and select an action as `Terminate` to take in case of HTTP 400. If `Passthrough` is selected, the webhook response will be displayed without modification.

7\. Enter an error message that will be displayed to the customer.

```
Sorry, I am terminating the session.
```

8\. Keep the Mapping toggle on.

9\. Enter a Key and JSONPath pairing for Result Mapping.

**KEY** `plan_list`

**JSONPATH** `$.plan-list`

10\. Enter the template to show to the customer as a response.

```
These are the mobile plans.
{{#plan_list}}

  {{plan-id}}: ({{name}})
  {{amount}}: {{data}}
  {{comment}}

{{/plan_list}}
```

11\. Click **Save**.

<figure><img src="https://2637928320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiRqPwZJVepiA6JYXHnaO%2Fuploads%2FGikGkcFXw4USD5f6ArVK%2Fimage.png?alt=media&amp;token=d3923a78-4b25-43a7-981f-67ea103c0d68" alt=""><figcaption></figcaption></figure>

12\. Click **Publish** to publish the Subject.

<figure><img src="https://2637928320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiRqPwZJVepiA6JYXHnaO%2Fuploads%2FAdsdedAgYS1S3WHEfv4x%2Fimage.png?alt=media&amp;token=daee7578-2a62-4716-b241-e2fb03d310ec" alt=""><figcaption></figcaption></figure>

13\. To test the subject, click on the sandbox button on the right side of the screen and enter the query statement configured, in this case, `I want to see mobile plans`.

<figure><img src="https://2637928320-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiRqPwZJVepiA6JYXHnaO%2Fuploads%2FYC27PVAVsTzZy1frRgss%2Fimage.png?alt=media&amp;token=693a8885-b448-41e1-bb25-2c6babb3acee" alt=""><figcaption></figcaption></figure>

\\
