Custom Functions | Help - Zoho Bookings

Custom Functions

Super admins and Admins can view and edit this information. Managers can only view this information. Staff will not have access to this information.

Custom functions help with automating actions that require procedural logic and that cannot be executed using default actions. For example, to send email or SMS notifications, we can use the Notifications feature, which is available by default. But let's say we need to create an invoice in Zoho Invoice as soon as an appointment is booked. Manually performing this task for every appointment is tedious, so we can automate it using Custom Functions by writing simple scripts in Deluge, Zoho's scripting language.  
 
Deluge has a predefined syntax for every action you want to perform. From running loops to using conditional statements, from integrating with other Zoho Services to making API calls to other external services and much more, Deluge covers it all.
 
Custom Functions can be triggered when an appointment is:
  1. Booked
  2. Rescheduled
  3. Canceled
  4. Marked as Completed
  5. Marked as No Show 
Useful information about the appointment is stored as key-value pairs in a map variable named "bookingInfo". This information is readily available for use while writing scripts using Custom Functions. The key can be used to retrieve a particular value. Learn about the applicable key-value pairs here.
 
To configure Custom Functions:
  1. Click the  icon in the top right corner.

  2. Navigate to Workspaces and click the required workspace.

  3. Choose Custom Functions.



  4. Click Configure next to the event for which the function must be triggered.



  5. In the Deluge editor that opens, write the required script.

  6. Click Save.
Scripts can also be executed instantly by clicking Execute.



Custom Functions will be triggered only for events that have been enabled by checking the relevant boxes.


Table displaying the fields along with the information they store

Field Name

Deluge Name (to be used in scripting)

Information stored

Booking ID

booking_id

ID of the appointment

Workspace ID

workspace_id

ID of the workspace in which the service exists

Workspace Name

workspace_name

Name of the workspace in which the service exists

Staff ID 

staff_id

ID of the concerning staff

Staff Name 

staff_name

Name of the concerning staff

Service ID

service_id

ID of the concerning service

Service Name

service_name

Name of the concerning service

Customer Email

customer_email

Email address of the concerning customer

Customer Name

customer_name

Name of the concerning customer

Customer Contact

customer_contact_no

Phone number of the concerning customer

Customer Booking Timezone 

customer_booking_time_zone

Time zone applicable to the customer 

Customer Booking Start Time 

customer_booking_start_time


Appointment start time

(applicable only to appointments raised by the customer)


Customer More Info 

customer_more_info

Values of custom fields added to registration form

Booking Start Time

start_time

Appointment start time in c ustomer's time zone

Duration

duration

Duration of the appointment

Cost

cost

Total amount for the appointment

Cost Paid

cost_paid

Amount paid so far for the appointment

Due Amount

due

Balance amount to be paid by the customer

Booked On

booked_on

Date on which the appointment was booked

Booking Status

status

Status of the booking

Booking Type

booking_type

Type of the service

Booking Summary URL

summary_url

Link to the booking summary

Time zone

time_zone

Time Zone of the business

Currency

currency

Currency in which the business sets the pricing

 
The fields are stored as keys, along with their values in a predefined map variable named "bookingInfo". To fetch a required key, use the Deluge get function. For example, to fetch the booking ID and store it in a variable named "bookingID", use the following snippet: 
  1. bookingID = bookingInfo.get("booking_id");
Learn about Deluge here.
Note: The number of workspaces that can be added is governed by the subscription plan that users hold with Zoho Bookings.

    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Get started with Zoho Sign

            in a few quick steps!

            Download Help Guide





                      Still can't find what you're looking for?

                      Write to us: support@zohoforms.com


                            




                            

                          Zoho Marketing Automation

                            Zoho Sheet Resources

                             




                                Zoho Forms Resources


                                  Secure your business
                                  communication with Zoho Mail


                                  Mail on the move with
                                  Zoho Mail mobile application

                                    Stay on top of your schedule
                                    at all times


                                    Carry your calendar with you
                                    Anytime, anywhere




                                          Zoho Sign Resources

                                            Sign, Paperless!

                                            Sign and send business documents on the go!

                                            Get Started Now


                                                Zoho SalesIQ Resources



                                                    Zoho TeamInbox Resources



                                                            Zoho DataPrep Resources



                                                              Zoho DataPrep Demo

                                                              Get a personalized demo or POC

                                                              REGISTER NOW


                                                                Design. Discuss. Deliver.

                                                                Create visually engaging stories with Zoho Show.

                                                                Get Started Now











                                                                                      • Related Articles

                                                                                      • Custom Labels

                                                                                        Super admins and admins can view and edit this information. Managers can only view this information. Staff members will not have access to this information.   Set personalized phrases for "Service", "Staff", and "Resource" using Custom Labels. For ...
                                                                                      • Custom Domain

                                                                                        Super admins and admins can view and edit this information. Managers can only view this information. Staff will not have access to this information. If you already own a domain for your business, you can attach the booking page to your domain. For ...
                                                                                      • Quickstart guide

                                                                                        Find the perfect time with your customers The fact that customer satisfaction is keystone to any business cannot be denied. With businesses increasingly becoming online, providing services to customer has only become more challenging. And also, with ...
                                                                                      • Zoho Bookings for Zoho CRM plugin

                                                                                        With the Zoho Bookings plugin, you can Schedule appointments with your Contacts and Leads in your Zoho CRM Email a link to your booking page to Leads and Contacts Add new Zoho Bookings customers as either Contacts or Leads in Zoho CRM Access all Zoho ...
                                                                                      • Zoho CRM Calendar Integration

                                                                                        Super admins and admins can enable the integration with the Zoho CRM calendar. Managers & staff do not have access to this information. Zoho Bookings allows appointments to be synced with Zoho CRM calendar and Zoho CRM calendar events to be synced ...
                                                                                      Wherever you are is as good as
                                                                                      your workplace

                                                                                        Resources

                                                                                        Videos

                                                                                        Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                        eBooks

                                                                                        Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                        Webinars

                                                                                        Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                        CRM Tips

                                                                                        Make the most of Zoho CRM with these useful tips.



                                                                                          Zoho Show Resources