Configure Actions

After creating the bot, you will need to create actions and configure the responses of those actions as required. You can generally choose to configure the response of an action to be either based on a business logic or a static direct response without involving any operation. In this tutorial, the response of all actions will be configured based on the execution of a business logic.

We will be creating the following set of actions for the ecommerce bot, so that the users can directly interact with the bot and perform actions whenever they need.

  • To list the products in the ecommerce store
  • To place a new order
  • To view the details of an order
  • To change the delivery address
  • To reschedule the order to a later date

In order to configure an action based on your application’s specific needs, you must define the appropriate sample sentences and params for it. In this section, we will be discussing in detail about the sample sentences and params to be configured for the actions mentioned above for your ecommerce bot.

After you create a ConvoKraft bot and choose the appropriate development platform to build the business logic, the bot’s details page will be displayed.

Follow the steps listed below to create and configure actions for the ecommerce bot:

  1. Click Create Action after you open the bot to add a new action.

create-bot-action

  1. We will create the first action for our ecommerce bot to list the items available in the store.

In the pop-up window that opens, provide the name of the action as “List the items available in Store”. Select the response as Based on a business logic, then click Next.

create-list-action

  1. Configure the applicable sample sentences. In a conversational way, the user would prompt this action in many ways, such as “list the items available” or “what are the products available in the store?”.

listofitems-sample

  1. We will not be configuring any params for this action. You can therefore skip this step and proceed to click Save.

params-page1

Similarly, the steps to create the remaining actions of the ecommerce bot are given below. The steps mentioned above will apply to all actions, and additionally you might be required to create params for certain actions.

Place an Order

  1. Create a new action from the bot’s details page to respond based on the business logic as discussed in the previous step, and name it as “Place an order”. The sample sentences for this action can be defined as follows:

    • “I want to place an order”

    • “I would like to place an order of the product id :5804508000000460006 to be delivered on 10-Jul-2023”

  2. Click Next after configuring the sentences.

place-order-sample

  1. Click New Param and select the param type, as instructed below.

Click String and a New Param dialog box will open. Provide the name for the param as “productid” and add a prompt message by referring to the table below. To learn more about the attributes of each param type in detail, please refer to this page.

productid

We will be creating the following params for this action :

Param Type Name Prompt message Prompt message for validation failure
String productid Please enter the Product ID The entered ProductID is invalid. Please check and retry.
Email cxemail Please enter your Email Address The entered email address is invalid. Please check and retry.
Date cxdate Please enter the date on which you expect the delivery The entered date is invalid. Please check and retry.
String cxaddr Please enter the address where you want the order to be delivered The entered address is invalid. Please check and retry.

In a similar way, create the other three params, “cxemail”, “cxdate”, and “cxaddr” with the param type and prompt messages as mentioned in the table above.

Note : The mode of input for a date param can be selected as Textual or Visual, as per your preferences.
  1. You can map the params with the corresponding text in the sample sentences, in order to instruct the bot to prompt the inputs from the user consecutively in the conversation.

For this, hover over the text in the sample sentence and choose the corresponding param to associate them.

place-order2

  1. After configuring the sample sentences and params for the action, click Save.

View Order Details

  1. Create a new action, and choose to configure a response based on business logic. Name it as “View Order Details”.

  2. Add the following create a ConvoKraft bot for the action :

  • “Where is my order?”

  • “I want to view my order details of email id amelia.burrows@zylker.com

  • “I want to check my order details”

view-order-sample-sentences

  1. Define the params specified below for the action as discussed in the last section. You can associate the params with the sample sentence as shown in the screenshot above and click Save.
Param Type Name Prompt message Prompt message for validation failure
Email cxemail Please provide the email address associated with your order The entered email address is invalid. Please check and retry.

Change Delivery Address

  1. Similar to the actions created above, we will be configuring the response of this action to be based on a business logic. Enter the name of the action as “Change Delivery Address”. For this action, you can define the sample sentences given below :
  • “I want my order to be delivered at a different address”
  • “I want to change delivery address for my order id 5804508000000460006 under the email amelia.burrows@zylker.com

Add the params given below for the action:

Param Type Name Prompt message Prompt message for validation failure
Email cxemail Please provide the email Address associated with your order. The entered email address is invalid. Please check and retry.
String cxorderid Please enter your Order ID. The entered OrderID is invalid. Please check and retry.
String cxaddr Please enter the address where you want the order to be delivered. The entered address is invalid. Please check and retry.

You can associate the params as shown in the screenshot below and click Save.

change-delivery-address

Re-schedule order date

Enter the name of the action as “Reschedule order to later date”. You can define the below sample sentences for the action:

  • “Reschedule my order to later date”
  • “Postpone the delivery date of my order”
  • “I want to change my order’s delivery date as 19/07/2023 for my order id 5804508000000460006 of my email amelia.burrows@zylker.com

Add the params below for the action :

Param Type Name Prompt message Prompt message for validation failure
Email cxemail Please provide the email ID associated with your order. The entered email ID is invalid. Please check and retry.
String cxorderid Please enter your Order ID. The entered OrderID is invalid. Please check and retry.
Date cxdate Mention the date you would like to reschedule your order The entered date is invalid. Please check and retry.

reschedule-order-sample

The actions are now configured for the bot.

all-actions

Last Updated 2024-05-20 18:33:27 +0530 +0530