Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content

Setting up Functions

How Can I...

Note

All functions programmed by your developers are listed on the Functions page. By this way, programmers can focus on developing Deluge Scripts whereas CRM Administrators can deploy the thoroughly tested functions as per their requirement.

Set Up Functions

You can set up functions in 6 places:

  • Create a standalone function.
  • Associate function to a workflow rule.
  • Use functions later by including them in Schedules.
  • Set the function to get executed upon the click of a Custom Button.
  • Associate a function to a Related List.
  • Associate a function to Validation rules.

To create a function

  1. Go to Setup > Developer Hub > Functions.
  2. In the Functions page, click + Create New Function.
  3. Choose the place where the function is meant to be added.
  4. Click Next.
  5. In the Create Function page, do the following:
    • Give a Name and description(optional) for the function.
    • Click Edit Arguments.
    • Set the arguments to be used in the script, with field name or custom value in CRM module.
    • Write your required function in the Deluge Script Editor.

    • Click Save & Execute Script to validate your code.
    • Click Save.
  6. Click Save.
    The function will be listed in the List View of the Functions page.
    Please note that the functions specified to be used at a particular location cannot be used elsewhere. For example: a function configured for Workflow Rules cannot be used in Schedules.

Calling Functions using REST APIs

A function lets you have additional functionalities and features in your CRM apart from the conventional features. Functions needs a trigger to call it. The trigger could be in the form of a workflow, blueprint, related list or through the click of a button.

If the function needs to be triggered without employing these methods or from external sources, you can create standalone functions and make them available as API calls. Triggering functions through REST APIs which gives the flexibility to trigger it from anywhere inside Zoho CRM or from any third party application.

Sample function as an API call:

A form which automatically generates a lead in your CRM with the information given as input in the form.

Step 1:

Create a standalone function with the following code.

Note:

  • The arguments to be passed for the above function are "FirstName", "LastName", "Company" and "Mobile". Datatype for the arguments is STRING.

Step 2:

To make function available as an API

  1. Go to Setup > Developer Hub > Functions.
  2. Click the Settings icon for the corresponding function which needs to be made an API.
  3. Click REST API.
  4. The API Name field displays the API name of the function which you must use to invoke it. This API name is system-generated; you cannot modify it.
  5. Enable OAuth2.0 and the API key sliders.
  6. Click Save.

Note:

  • Select OAuth2.0 for sharing the function as an API within your organization.
  • Select API Key for sharing the function with any third party and enable it to be used by anyone. This API key is static, and does not expire unless revoked. You can regenerate the API key any time by clicking the Regenerate API key button. When you regenerate your API key, the old key becomes invalid and any requests made using the old key will be rejected. This can be beneficial in case your API key is compromised or you need to revoke access for any reason. Please be aware that the API key is common for all the functions, and that regenerating the key will reflect in all the functions. After regenerating the key, make sure to update any applications that use the old key with the new key to ensure that they continue to function properly.
  • Note that only admin users have access to the Regenerate API Key option.

Step 3:

The sample here is shown as a form created using Zoho Creator. Create the form such that it has the fields "FirstName", "LastName", "Company" and "Mobile". You can program the function to get executed upon the click of Submit button.

Result:

Once the Submit button is clicked, the function gets executed and the Lead is created in your CRM. The lead has the details which was given within the form.

Functions in Postman:

Functions which are given as API calls can be tested using POSTMAN application. However, there are a few things that you need to keep in mind when executing a function in that app.

  • The current supported methods for using a function as an API are GET and POST.
  • In a POST request, under the "Body" section, select "form-data".
  • Create a Key named "arguments" and the Value as the Input JSON object.
  • The arguments can also be given in the URL as arguments={encoded_arguments}
  • POST request - Arguments Limit
    • In request URL - 5000 characters
    • In body - 95000 characters (as JSON object)

Sample arguments in "Body":

{
  "First_Name":"Art",
  "Last_Name":"Clayton",
  "Company":"Zylker",
  "Mobile":"555-876-4367"
}

Deploying Functions in Workflow Rules

To associate function to a workflow rule

  1. Go to Setup > Automation > Workflow Rules.
  2. On the Workflow Rules page, click + Create Rule.
  3. In the Create New Rule tab, specify workflow rule parameters.
  4. Under Instant Actions, select Function.
  5. In the Configure Function page, select a function from the Gallery, Functions (Created by users in your organization) or Write your Own using Deluge script.
  6. Click Functions (Created by users in your organization).
  7. Select the function to be triggered and click Configure.
  8. In the Configure Custom Function page, complete the following steps:
    • Select the module to be associated.
    • Previous Value: You can configure the old value (data) of a field and pass it as a parameter in a function. When you edit a record, the system will trigger a workflow and pass the value of the field (the value stored before the field's edit) as a parameter.
    • Under the Argument Mapping, specify a dynamic name in the Key section, and in the Add Merge Field, select the Execution-Info option. Then, choose the Previous Value option, to get a previous value.

      Here is an example of how to configure the old values of the fields:

       oldEmail= preValues.get("Email");  //The name 'preValues' is a dynamic name used in the above mentioned examples. You can use any name that suits your needs.
      Previous Value
      Source: 
      To ensure whether your workflow was triggered due to a merge (using Find and Merge Duplicates) or a regular delete in a function, pass the "Source" value as an argument in your function. When two records are merged, the system updates the main record and deletes the child record. 

      Example: Consider two records: a main record and a child record. The main record has an email value, while the child record has no email value. When these records are merged, the email value of the child will be merged with the parent record, updating it, while the child record will be deleted. 

      By using "Execution-info -> Source," you will receive the value "Update(merge)" for the main record and "Delete(merge)" for the child record.

      Code Representation
      This will help you understand exactly what caused the workflow to run and handle the records accordingly.

      Notes:

      For Previous Value:

      • The workflow will be triggered only when the record is edited.
      • You cannot configure data for multi-line and lookup fields.
      • You cannot retrieve the previous values of subforms and multi-select lookup fields.

      For Source Value:

      • The "Execution-info > Source" is supported only for merging records using Find and Merge Duplicates.
      • Click Save.
  9. Click Saveon the Workflow rule page.
    Now, your function is associated with the workflow rule. When the workflow rule is triggered, the function will be automatically executed.

See Also - Integrate a function to a Schedule, Custom Button, Validation Rule, and Related List.

To test the function integration

  1. Add test data in Zoho CRM according to your workflow rule criteria.
  2. Check for the data received from Zoho CRM via function, in your application.
  3. Modify your function code in Zoho CRM, if data is not received or if there is a data mismatch.
  4. Continue this test until you obtain the required data from Zoho CRM to your Application.

Important Notes

  • You can associate up to 6 (1 Instant Action and 5 Time-Based Actions) functions per workflow rule.
  • Zoho CRM will the send the data in following standard format for Date and Date Time fields to third-party applications:
    • Date: yyyy-MM-dd
    • Date Time: yyyy-MM-dd hh:mm

Refer Error Codes

When the execution of function fails, one of the following error messages will be displayed in Zoho CRM:

HTTP Status Codes

  • 400 Bad Request - Often missing a required parameter.
  • 401 Unauthorized - No valid API key provided.
  • 402 Request Failed - Parameters were valid but request failed.
  • 404 Not Found - The requested item doesn't exist.
  • 500, 502, 503, 504 Server errors - Error in the third-party application.
  • Error Code 1 - Temporarily not able to connect to the API server. Check API server logs, firewalls settings for requests sent from CRM.

Custom Errors

  • Internal process failure - When the function is not executed due to errors in processing of the script.
  • Day limit reached - When the company has reached the maximum limit for the day.
  • Deluge Script - When the execution of workflow triggers fail due to errors in Deluge Script.