Zobot is Zoho SalesIQ's virtual chat agent that is designed to interact with website visitors conversationally. Zobot automates the process of interacting with website visitors and helps to maintain the presence of a helping hand, even when all the live agents are not available. The following sample use case demonstrates a real-time bot built on Zobot powered by Zia Skills Platform.
Example scenario - Service appointment booking
Consider an imaginary company, Zylker Inc. which is a burgeoning local services marketplace. Zylker helps customers to hire professionals for various field services like housekeeping, vehicle maintenance, appliance repairs and so on. Once a customer schedules an appointment, Zylker assigns a field professional to complete the requested service.
In the current process of Zylker, to schedule a service appointment, customers have to chat with a live agent through the live chat option in Zylker's website (powered by Zoho SalesIQ).
Zylker's website with their live chat option.
A typical conversation between an agent and a user trying to schedule an appointment would be like below.
However, the demand for Zylker's services have increased and it is challenging for them to manage the appointment requests through live chats, since it would require a lot of manpower, which would be expensive. Hence they plan to automate the appointment booking process using a bot using Zobot (powered by SalesIQ).
As inferred from the aforementioned conversation (between the agent and the user) the following details are required by Zylker from the user, to schedule a service appointment.
- Name of the customer
- Mobile number of the customer
- Address of the service location
- Category of service (Car wash, Painting, Cleaning etc.)
- Preferred date of service
Thus, in order to create a service appointment, the bot has to prompt these details to the user, just like how an agent did in the live chat.
Creating a Zobot backed by Zia Skills
- Create a bot in SalesIQ ( under Settings -> Zobot ) for Zylker's website.
- Choose Zia Skills for the option 'Which platform would you like to use to develop your bot?'.
- In the integration page, 'Skill name' and 'Skill description ' would have been auto populated. You can change them if needed.
-
Enter a valid 'Trigger Response' (bot's welcome message to the user) in JSON format and click CREATE. In this case,
- {
- "replies": [
- {
- "text" : "Welcome to Zylker services"
- }
- ]
- }
|
The Zobot would have been created now. Conversational abilities can be added as actions to this bot from Zia skills console.
Modelling service appointment booking as an action
- Click Access Zia Skills Console on the top right corner of the integration page to access the developer console of Zia Skills. It will redirect you to the mapped bot in Zia Skills.
- In the bot's details page, under the ACTIONS tab, click + ADD ACTION. The Create New Action page appears.
- Enter a meaningful 'Action Name', that reflects the purpose of this action - in this case, "Service appointment booking ".
- For 'What should this action do? ', choose Perform an operation, since this action carries out something on behalf of the user.
-
Under 'How will this operation be invoked? ', define the sample invoking sentences that users would say to invoke this action. For instance,
I would like to schedule a service appointment
Use the plus icon + besides the last entered text box to add further sentences.
- Practically, people would include data as part of invoking instruction and hence sample sentences may also include certain param values. For instance, in this case, we can have a sample sentence as
Book an appointment for painting
- Here the user mentions the type of service needed (painting). It has to be marked as a param. Select the word "painting" and the NEW PARAM pop-up appears.
- Mention a meaningful 'Param Name'. In this case, 'servicename', since this param defines the type of service.
- Choose the appropriate 'Param Type'. In this case, String.
- Enter a relevant 'Prompt message', which would be displayed to the user to prompt this param, if the param value is not given in the invocation sentence. In this case, "Which service are you looking for? (Painting/ Cleaning/ Car wash/ Electrical works)".
- Click ADD. The param appears in the PARAMS list.
- Similarly we shall add more meaningful sample sentences.
I want to schedule a car wash on Monday.
In this sentence mark car wash as 'servicename' param and mark Monday as a new param 'visitdate' of 'Param Type' Date with 'Prompt message' "What's your preferred date for the service?"
-
Define the remaining params as follows using +NEW option in the PARAMS list.
Remaining details required
|
Param name
|
Param type
|
Prompt message
|
Name of the customer
|
name
|
String
|
May I have your full name, please?
|
Mobile number of the customer
|
mobile
|
Number
|
May I have your mobile number, please?
|
Address of the service location
|
location
|
String
|
What is the address of the service location?
|
Note that the params will be prompted to the user in the order mentioned under PARAMS list. We shall reorder the added params now to have a better contextual conversation. To reorder the param, click the param and place in the appropriate position.
The appropriate order of params for this action are, i. name
ii. mobile
iii. location
iv. servicename
v. visitdate
-
Click DONE. It displays the Configure Functions page as below.
Functions are custom hooks written by action developers that are invoked by Zia Skills during action execution at various points. The fulfilment or the actual business logic of the action is defined in the Execution function. It is executed after all params are prompted and got from the user. It gives the final success (or failure) message to the user indicating the action completion.
-
Click EDIT EXECUTION FUNCTION, that would fulfill the core business logic of the action.
The core business logic of this action is to store the appointment details in Zoho CRM and give an appropriate reply message to the user.
To store the prospect's information in Zoho CRM, this function should hit an authenticated API of Zoho CRM. To handle the authentication between Zia Skills and Zoho CRM, we are using Deluge Connections. The API authentication scope to be used in the connection in ZohoCRM.modules.ALL.
The function to be used as follows.
- result = Map();
- vdate = visitdate.toString("YYYY-MM-dd");//Zoho CRM's one of the supported date format is YYYY-MM-dd
- fields = Map();
- fields.put("Name",name);
- fields.put("Contact",mobile);
- fields.put("City",location);
- fields.put("Service_Type",servicename);
- fields.put("Service_Date",vdate);
- response = zoho.crm.createRecord("Forms",fields); //Making API call to create a record in Zoho CRM
info response;
- //Returning the appointment from Zylker service center
- displayCard = list();
- imageMap = Map();
- imageMap.put("type","image");
- imageURL = "https://i.ibb.co/1XgLJ4G/car-care-service-image.jpg%22;
- imageMap.put("content",imageURL);
- imageMap.put("text","The approximate cost for this service would be around $15.");
- noteMap = Map();
- noteMap.put("type","note");
- noteMap.put("content",name + "," + " I've scheduled an appointment for your " + servicename + " on " + visitdate);
- displayCard.add(noteMap);
- displayCard.add(imageMap);
- result.put("card",displayCard);
- result.put("message","I've schedule an appointment successfully");
- return result;
|
-
Click Save Script to save the code and click DONE on the top right corner to complete the new action creation, it will navigate you to the action's details page.
-
Go to the bot's details page, and click DEPLOY TO PRODUCTION to move the action to production.
The created action can be tested in the bot preview window in Zoho SalesIQ.
Thus this bot now can attend live chat from visitors and could schedule actual appointments without agent intervention. Embedding this bot into your website would take this bot to production.
Furthermore, it arises that Zylker doesn't operate on weekends. Hence this bot should be made not to accept appointment requests to service on these days. i.e. technically the Zobot has to validate the user's input for the param 'visitdate' and make sure that it dosen't fall on weekends. This is achieved through the Context handler function.
Context handler function is used to control the conversational flow of an action. It can be used to do custom validations of the param values and change the order in which the params are prompted in runtime.
User input validation with Context Handler Function
- To enable the Context handler function, in the Configure Functions page, click the Enable option under Context Handler Function. It displays a pop-up window for confirmation, click OK.
-
It will be redirected to the function's page. The below logic will go as the Context Handler function for Zylker's requirement.
- Click Save Script to save the code and click DONE on the top right corner, it will navigate you to the action's details page.
- Go to the bot's details page and click DEPLOY TO PRODUCTION to move the code changes to production.
The created action can be tested in the bot preview window in Zoho SalesIQ.