> 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/components/normal-components/parameter-bundles.md).

# Parameter Bundles

### Before you begin

* This tutorial requires a webhook setup. Add a test webhook URL to your webhook settings.

```
http://mock-webhook.mind.ai
```

* This tutorial requires two entity types for the Parameter setups. Add regex entity types "Account Number" and "MSISDN" in Knowledge.

**Account Number**

**Regex Pattern Block 1**

**REGEX PATTERN** `^[0-9]{8}$`

**DESCRIPTION** `8 digits`

***

**MSISDN**

**Regex Pattern Block 1**

**REGEX PATTERN** `[nN]?[fF] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ? [0-9] ?[0-9]`

**DESCRIPTION** `9 digits: 1st digit can be n or N, 2nd digit can be f or F`

***

**Regex Pattern Block 2**

**REGEX PATTERN** `[1,2,3,6,8,9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9]`

**DESCRIPTION** `7 digits: 1st digit can be 1,2,3,6,8,9`

**Regex Pattern Block 3**

**REGEX PATTERN** `[1,2,3,6,8,9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9]`

**DESCRIPTION** `8 digits: 1st digit can be 1,2,3,6,8,9`

**Regex Pattern Block 4**

**REGEX PATTERN** `[0,1,2,6,8,9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9]-?[0-9](-?[0-9A-Za-z])?`

**DESCRIPTION** `10 digits with " - " in between of each digit`

**Regex Pattern Block 5**

**REGEX PATTERN** `[0,1,2,6,8,9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9] ?[0-9]( ?[0-9A-Za-z])?`

**DESCRIPTION** `10 digits: 1st digit can be 0,1,2,6,8,9 and last digit can be 0-9, A-Z, a-z)`

### Add Parameter Bundle

Add a Parameter Bundle to set up each Parameter.

1. Click **Add Component** in the Components panel.
2. Click **Parameter Bundle**.

![](/files/bIOYVwKWW9vqXr4ifiIG)

3\. In the popup, enter Parameter Bundle name as "Verify" and Parameter names as "Name", "Product", and "Phone Number".

4\. Deselect the Required checkboxes of `Phone Number` Parameter as they are optional.

5\. Click **Add**.

![](/files/QNnduhIyvX0s7oUWLu9a)

### Set up Parameters

To start setting up a Parameter, see if the Parameter is required or optional first. As mentioned above, optional Parameters are not invoked by default. For optional Parameters, you can set a Binding Expression which is a JSONPath expression to extract a default value from the conversation context, which is most likely a return value from a webhook. You can also set a Default Value, which is the specific value of the Parameter. If the customer gives another value, the Parameter is overwritten with the value provided by the customer.\
\
Also, check if the Parameter value is single or compound. A single value means the Parameter has only one entity as a value, while a compound value possibly includes multiple entities. Compound value Parameters need Designator. Key Path to indicate the specific value to use among the values. If the value that you want to extract is in the collection, write a chain of keys without specifying the location inside the collection.

To collect the Selection Term or Query Statement, you need to set up the Selection Class with Check. Only one Check action can be added to a Selection Class. Check allows you to get the Selection Term or Query Statement from the customer, system, or both.

{% tabs %}
{% tab title="Required Parameters" %}
**For Single Value**

1. Select the `Name` Parameter in the Components panel to set it up.

![](/files/KAz08J8g1sqUGAKiKJla)

2\. In the Component Settings panel, stay in the `Single Value` tab.

3\. Enter "Name" for Local Binding Key. This key will be used locally in the current Subject and store the Parameter value.

4\. You can optionally enter the data source, which is a collection of objects where data is extracted via the key list. This case doesn't require the data source.

5\. Set up the entity type to determine the data type of Parameter as "Any Entity" in System Entities.

6\. Click **Save**.

![](/files/zrbN8XbTdOuVcGAehVqr)

**For Compound Value**

1. Select the `Product` Parameter in the Components panel to set it up.

![](/files/jZkZIWusMBTyNcE7U6oT)

2\. In the Component Settings panel, select the Compound Value tab.

3\. Enter "Product" for Local Binding Key. This key will be used locally in the current Subject and store the Parameter value.

4\. You can optionally enter the data source, which is a collection of objects where data is extracted via the key list. This case doesn't require the data source.

5\. Set up the entity type to determine the data type of Parameter as "Account Number" in My Entities. Compound Parameters can have multiple entity types.

6\. You can optionally enter Designator. Key Path, which is the chain of keys indicating the specific value to refer to. Enter Designator. Key Path as "$.mind-visions.id".

7\. Click **Save**.

![](/files/AhcI9LEliWAeFzic6TTk)
{% endtab %}

{% tab title="Optional Parameters" %}
**For Single Value**

1. Select the `Phone Number` Parameter in the Components panel to set it up.

![](/files/T0dgOjGRADqZwZDRhV9n)

2\. In the Component Settings panel, stay in the Single Value tab.

3\. Enter "PhoneNumber" for Local Binding Key. This key will be used locally in the current Subject and store the Parameter value.

4\. You can optionally enter the data source, which is a collection of objects where data is extracted via the key list. This case doesn't require the data source.

5\. Set up the entity type to determine the data type of Parameter as "MSISDN" in My Entities.

6\. You can optionally enter Binding Expression, which is a JSONPath expression to extract a value from the conversation context when the Parameter isn’t called out by the customer, or enter Default Value, which is a preset value when the Parameter isn’t called out by the customer. This case doesn't require a default value.

7\. Click **Save**.

![](/files/Q07kJ3yeD6shIpJtvMEP)
{% endtab %}
{% endtabs %}

### Collect Parameter Value

To collect the Parameter value, you need to set up a Check action to the Parameter. Check allows you to get the Parameter value from the customer, or both customer and system.

{% tabs %}
{% tab title="Check with customer" %}
Check with customer is a way to prompt the customer to get the value. This is an example in a `Verify customer` Subject to get the `Name` Parameter value from the customer.

**CONVERSATION PREVIEW**

![](/files/Kaf0LrpG8tJymzYZj6gg)

1. Select the `Name` Parameter in the Components panel and click **Add Action** in the Conversation panel.
2. Click **Check** and stay in the `Customer` tab in the Action Settings panel.

![](/files/Nv6agkxc4px5VTwz1FzD)

3\. You can optionally enter an instruction to be displayed before the prompt in the Action Settings panel. This can be an instruction for the customer to follow or additional information. This form can include Mustache template language. Enter the message as below.

```
Let me verify your name.
```

4\. Enter the prompt to the customer as "What is your full name?".

5\. Select the number of max prompt attempts which is how many times the prompts will be repeated in case of not getting the expected response.

6\. Click **Save**.

![](/files/IPhuSvtWWDi18AIjNoxJ)

When the Check action is set up, the expected customer response will be shown with the binding key.

![](/files/N3W5BXONDiFmXj6HdkPJ)
{% endtab %}

{% tab title="Check with customer using webhook" %}
Check with customer using webhook is a way to prompt the customer to get the value. This is an example in a `Verify customer` Subject to get the `Product` Parameter value from the customer using a webhook.

**CONVERSATION PREVIEW**

![](/files/5Sbqw1BInxSsmIa22kMS)

1. Select the `Product` Parameter in the Components panel and click **Add Action** in the Conversation panel.
2. Click **Check** and select the `Combined` tab in the Action Settings panel.

![](/files/YbwYkReBfb8WpN7Zvy61)

3\. 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/tv-account?code=200&out=m`.

***

**Webhook URL (Method: GET)**

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

**URL PARAMETER** `tutorial/tv-account?code=200&out=m`

***

**Response Body**

```
{
  "mind-visions-quantity": "multiple",
  "mind-visions": [
    {
      "name": "Mind Vision",
      "id": "92741023",
      "etc": "Mind Economy Package",
      "desc": "Mind Economy Package with 120 channels"
    },
    {
      "name": "Mind Vision",
      "id": "91244132",
      "etc": "Mind Sports Extra Package",
      "desc": "Mind Sports Extra Package with 180 channels"
    },
    {
      "name": "Mind Vision",
      "id": "72364018",
      "etc": "Mind Movie Lover Package",
      "desc": "Mind Movie Lover Package with 250 channels"
    }
  ]
}
```

4\. Select the request method as `GET`.

5\. 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.

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

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

7\. Decide if you want to escalate the session by turning the Escalate on Termination toggle on or off. It will send the entire chat script to your backend system upon the termination. To turn on the escalation, you need to have an escalation webhook set up in the Scope.

8\. Optionally, you can enter Key and JSONPath pairings for Result Mapping. Enter Key and JSONPath pairing as below.

**Result Mapping Pair 1**

**KEY** `mind-visions`

**JSONPATH** `$.mind-visions`

9\. You can optionally enter an instruction to be displayed before the prompt in the Action Settings panel. Enter the instruction as below.

```
Account List:
{{#mind-visions}}
  {{name}}: ({{id}})
{{/mind-visions}}
```

10\. Enter the prompt to the customer as "Which account do you want to continue with?"

11\. Select the number of max prompt attempts which is how many times the prompts will be repeated in case of not getting the expected response.

12\. Click **Save**.

![](/files/SMs1lcXEZTxDWEWA0Ne4)

When the Check action is set up, the expected customer response will be shown with the binding key.

![](/files/m4sBfdsQtV3sD2g2db01)
{% endtab %}
{% endtabs %}
