Custom Functions
Custom functions in Zoho Payroll are programs that you can create to automate payroll calculations and make your job easier. They’re like digital assistants that can do the tricky and repetitive tasks for you and help you keep track of things like pay, loans and employees.
Custom Functions in Zoho Payroll allows you to simply drag and drop code to automate your payroll processes. They allow you to create your own calculations or rules that are specific to your business needs.
Using custom functions, you can update the data in automatically by executing simple program scripts, which are written using the low-code programming language, Deluge.Using Custom Functions in Zoho Payroll, you can program scripts using Deluge Script, associate them to workflow rules, and automate the process based on your organisation’s needs.
Custom functions are available for different modules of Zoho Payroll, such as employees, pay run, and loans.
Here are a few use cases for custom functions in Zoho Payroll:
Shift differential pay calculations: You can create a custom function that calculates shift differential pay for your employees who work night shifts or other non-standard shifts.
Custom Health Insurance Deductions: Implement a custom function to calculate health insurance premiums or deductions based on employee preferences, dependents, and coverage options.
There are several benefits of using custom functions in Zoho Payroll:
- Customization: Custom functions allow you to create calculations or rules that are specific to your business needs. This means that you can customize your payroll calculations to fit your unique requirements and ensure that you’re paying your employees correctly and fairly.
- Time-saving: Custom functions can save you time by automating your payroll calculations. Instead of manually calculating each employee’s pay, you can use custom functions to automatically calculate pay based on specific rules or calculations that you’ve set up.
- Consistency: Custom functions can help to ensure consistency in your payroll calculations. By using the same custom functions for each pay period, you can ensure that all employees are being paid correctly and fairly.
- Scalability: Custom functions can be scaled up as your business grows. As you add more employees or change your payroll requirements, you can modify your custom functions to fit your changing needs.
Create Custom Function
- Click the Settings icon at the top right side and click Automation.
- Click Custom Functions under Automation.
- Click + Add New on the top right corner.
- Enter the name and description for your custom function.
- Select the module for which you want to trigger the custom function. You can create custom functions for employees, loans and pay runs.
- Write the function in the deluge script editor.
- Click Save.

Insight Deluge or Data Enriched Language for the Universal Grid Environment is an online scripting language that lets you program your own functions and add different types of business logic as required.
Pro Tip You can quickly access the support and guide related to Deluge in the top right corner of deluge script editor.
Associate Custom Function To Workflow Rules
Once you create a custom function, you can associate it to a Workflow Rule. Here’s how:
- Click Settings in the top right corner and select Automation.
- Click Workflow Rules and click + Add New in the top right corner.
- Enter a Name and Description for your workflow.
- Select a Module for which you want to trigger the workflow.
- Choose the Workflow Type and when you want to trigger the workflow.
- Besides the Event and Date-based triggers, you can optimize the triggers by setting additional filters under Filter the triggers.
- Under Actions, choose the Type as Custom Functions and select the custom function you want to associate with the workflow rule.
- Click Save.

Edit Custom Function
To make changes to the custom functions you have created:
- Click the Settings icon at the top right side and click Automation.
- Click Custom Functions under Automation.
- Hover over the Custom Function you want to edit and click the More icon next to the webhook.
- Click Edit and make the necessary changes.
- Click Save.

Delete Custom Functions
You can delete a custom function when you no longer need it. To delete a custom function permanently:
- Click the Settings icon at the top right side and click Automation.
- Click Custom Functions under Automation.
- Hover over the custom function you want to delete and click the More icon next to the custom function.
- Click Delete.
