In a nutshell
Functions in Zoho Creator are essential building blocks for implementing custom business logic using Deluge, Java, or Node.js. They act as modular units that can be invoked and reused across various components within an application or even shared between different applications. By encapsulating complex logic, functions promote better organization, enhance code readability, and simplify long-term maintenance.
Availability
Functions in Zoho Creator promote the reusability of Deluge, Java, or Node.js scripts within an application or across multiple applications. They help modularize your logic, making code easier to maintain and understand. When you need to perform the same operation in different parts of your application, you can define that logic as a function and reuse it. Functions can also accept input parameters and return output values, enabling flexible and dynamic scripting.
Key functionalities of functions
Bridge the gap between applications: In addition to defining generic utilities as functions, you can also use Deluge functions to access and manipulate data across applications within your Zoho Creator account. This enables one application to operate on the data of another, similar to how member functions interact with objects in object-oriented programming. With this capability, applications can seamlessly communicate through functions, supporting more connected, efficient, and scalable solutions.
A Deluge function is used to implement logic using Zoho Creator’s native scripting language. It supports a wide range of capabilities, including handling various data types, performing collection operations, making API calls, and manipulating form objects. With Deluge functions, you can pass form objects as arguments to modify records and return computed results, making them ideal for data processing and application logic. These functions can also be invoked directly from the Creator UI through report actions as well as panels and buttons in pages, enabling seamless integration between user interactions and custom functionality.
Business use case:
An organization uses Zoho Creator to manage its operations through two separate applications: “Sales Orders” and “Inventory Management.” To ensure accurate stock tracking, a Deluge function is used to synchronize data between these applications. When a sales order is confirmed, the function is invoked to receive the product ID and ordered quantity, locate the corresponding inventory record in the other application, validate available stock, and deduct the required quantity from current stock levels. By automating this cross-application update through a reusable Deluge function, the organization ensures real-time inventory accuracy and prevents stock-out issues across its order processing workflow.
A Java function allows developers to write and execute custom Java code within Zoho Creator. It is especially useful when an application requires complex computations, integration with external Java libraries, or processing large datasets efficiently. They also support object-oriented programming, giving developers the flexibility to structure code using classes, methods, and reusable components.
Business use case:
An insurance company uses Zoho Creator to manage policy applications and premium calculations. Premium calculation involves risk scoring, actuarial formulas, and age-based multipliers. A Java function is created to process the applicant’s age, coverage amount, lifestyle factors, and claim history using advanced mathematical models. The function returns the final premium instantly, which is then displayed in the policy application form. This ensures accurate results, faster processing, and consistent application of complex rules.
A Node.js function enables you to write and execute server-side JavaScript within Zoho Creator, allowing them to build advanced logic using Node.js packages. Node.js functions are particularly useful when the application needs to handle asynchronous operations, integrate with third-party services, or process JSON-heavy data structures efficiently. They allow developers to leverage modern JavaScript features, perform non-blocking I/O operations, and incorporate external NPM libraries to extend an application's capabilities. Node.js functions
Use case: A manufacturing company uses IoT sensors to monitor machine temperature, vibration, and energy consumption. The IoT gateway sends bulk data to a cloud endpoint that exposes the data over a REST API. A Node.js function is used to fetch the data asynchronously, filter out noise, apply threshold checks, and generate alerts when abnormal readings are detected. The filtered data is pushed into Zoho Creator reports and dashboards for real-time monitoring. This enables predictive maintenance and reduces machine downtime.
Note: For Java and Node.js functions the namespace will always be Default and it cannot be modified.The next step after understanding about functions is to learn how to configure them effectively to implement your business logic.