Plug Response:
Response configuration on Plugs:
In general, plugs are used to do customized actions and external third-party integrations in the Codeless bot. You can save the visitors' responses on the bot context and provide them as plug input to do the required action. Once the plug is executed the expected output can be mapped to the plug output parameter and brought inside the codeless bot to display it to the visitor. Let's take an example to understand better.
Example: Scheduling an appointment using Zoho Bookings.
Step 1: Configure the input and output parameters for the plug:
- Provide the inputs, output parameters, and their datatypes required to execute the plug.
- In this example, to schedule an appointment in Zoho bookings, we need the visitors' names, email, phone, and date & time as the plug input.
- Once the plug is executed, it will return the Booking ID of the appointment and set a parameter for it.

Step 2: Provide the logic for the plug execution:
- Fetch the input parameters from the session object in the plug script.
//Calling the input parameters
name = session.get("name").get("value");
email = session.get("email").get("value");
phone_number = session.get("phone").get("value");
datetime = session.get("datetime").get("value");
- Then write the logic for the plug to execute. In this example, give the JSON response for scheduling an appointment in Zoho Bookings.
//create appointment in Zoho bookings API
customerDetails = Map();
customerDetails.put("name",name);
customerDetails.put("email",email);
customerDetails.put("phone_number",phone_number);
//Variable the store the success JSON output of scheduling an appointment in Zoho Bookings
create_booking = zoho.bookings.createAppointment(service_id,changed_formate_datetime,customerDetails,staff_id,"Asia/Calcutta",true,"zohobookings");
Step 3: Set the required data in the Plug's output:
- Store this bookings API response in a variable (create_booking), then the booking id from this response can be set as the output parameter "bookingid" in the plug's response
Note: Map the variable to be shown as output with the output parameter declared in the "Parameters"

- Then, Save, test the plug and Publish it to be listed in the Codeless bot.
Sample Plug Script
response = Map();
name = "";
phone = "";
email = "";
datetime = "";
//The service_id and staff_id of Zoho Bookings
service_id = "4302354000000026055";
staff_id = "4302354000000026017";
//Calling the input parameters
name = session.get("name").get("value");
email = session.get("email").get("value");
phone_number = session.get("phone").get("value");
datetime = session.get("datetime").get("value");
//Changing the datetime format
change_format = datetime.get("date_time").replaceFirst("T",",");
changed_formate_datetime = toTime(change_format,"yyyy-MM-dd,HH:mm");
//create appointment in Zoho bookings API
customerDetails = Map();
customerDetails.put("name",name);
customerDetails.put("email",email);
customerDetails.put("phone_number",phone_number);
//Variable the store the success JSON output of scheduling an appointment in Zoho Bookings
create_booking = zoho.bookings.createAppointment(service_id,changed_formate_datetime,customerDetails,staff_id,"Asia/Calcutta",true,"zohobookings");
info create_booking;
bookingid = create_booking.get("response").get("returnvalue").get("booking_id");
info bookingid;
response = Map();
response.put("bookingid",bookingid);
return response;To know more about the Zoho bookings plug, visit our plug templates here.
How to Incorporate Plugs In the Codeless bot builder?
- In your Codeless bot builder, under Action blocks, select the Plug block.

- Then, select the plug you would like to add to the bot's flow. Note: Only published plugs are listed here.
- Next, provide the input parameters (Default value/bot context) for plug execution.

- Provide a bot context to store the output of the plug and use it on the further block to display them to the visitor.