Bot Context Handler
The Context Handler can be used when the visitor engages in a conversation with the bot. Context is a data definition that is used to collect multiple inputs to perform a single action. The conversation is mostly in a question-answer format and can work in association with the Message handlers and trigger handlers i.e., the handlers can return a context instead of a message reply.
So, all the inputs defined in the context will be collected and the context handler will be invoked. In that case, the context handler is a piece of SalesIQ script that is invoked after collecting all the inputs for a particular context. Here are the various attributes passed from a bot to a context handler. To get started with the context handler, you must define a flow as the context map.
Example: Consider, you walk into a cloth store, one way or other you will be interacting with a salesperson and they will ask you a bunch of questions. Based upon your answers, they will provide you with what you need. The context handler works on the same way.
The attributes passed when a context handler is triggered are listed below:
Inputs | Type | Description |
answers | Map | Answers to the questions defined in the context |
visitor | Map | Details of the website visitor |
context_id | String | The ID of the context currently used |
request | Map | Details of the request |
Note:
- Each script handler/function will have an execution timeout of 90 seconds.
- Each API invocation from handlers using the invoke URL task should not exceed 40 seconds to be completed
- If there is any issue in the execution or response of one of the handlers, as a fallback bot will forward the chats to the department operators.
Context Handlers in Zoho SalesIQ - Bot
To embed the context handler script:
- Navigate to Settings > Bot > Zobot, click Add.
- Enter the name, choose the platform - SalesIQ Scripts, and then choose the brand.
- The Deluge code builder will appear.
- Then, choose the Context Handler in the drop-down.
- And then draft the script in the Context handler section, click Save and Publish.
Sample Output
Sample Code:
Copied
In this example, once the messages handler receives all the responses from the visitor and stores in a context and this context is returned to the context handler for scheduling an actual appointment using Zoho Booking.