Custom Functions

Custom Functions

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.

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. Learn more about Deluge.
 
Custom Functions can be triggered when an appointment is:
  1. Booked
  2. Rescheduled
  3. Cancelled
  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 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 and store the booking ID in a variable named "bookingID", use the following snippet:
  1. bookingID = bookingInfo.get("booking_id");
    • Related Articles

    • Custom Functions

      Custom functions help in automation where procedural logic is required, which cannot be implemented with the default actions such as, Tasks, Webhooks, etc. With custom functions you can automatically update the data in the related Zoho Recruit ...
    • Manage Custom Functions

      Custom functions allow users to develop and execute user-defined functions using Deluge. You can execute simple program snippets to automate processes, or integrate with third-party or Zoho applications.    Business Uses for Custom Functions Custom ...
    • Custom Functions

      The Manage Business icon in the top menu bar is your go-to for managing all of your booking preferences. This page discusses Custom Functions. Aside from the default flow of a customer booking, you can define additional workflows at each stage of the ...
    • Functions

      Functions are the building blocks for developing an extension. They come handy for all server side customization. Sigma executes functions without additional infrastructure cost. External function calls can be done using rest APIs. You have to ...
    • Custom functions

      Automate your issues workflow using Custom Functions. What Is a Custom Function? A custom function is a piece of code that can be used for automating a process. You can write your own function in Deluge and call it from one or more business rules. It ...