When you create an invoice in Zoho Books, the 'Amount' of a line item is typically calculated as the product of the "Quantity" and the "Rate" of the item. For instance, if an item has a sales rate of $50 and a quantity of 5 is sold, then the amount would be calculated as follows:
Amount = Quantity * Rate = $5 * $50 = $250.
There may be scenarios where you'd need to include a third variable to arrive at the item amount. Let's take the example of a rental business where you lend equipments and charge customers based on the duration of usage. In this case, the computation for the Amount field should be as follows:
Amount = Duration * Quantity of equipment lent * Rate.
For instance, if you rented out 2 pieces of equipment for 5 days at the rate of $10 per day, the amount should be calculated as 5 * 2 * $10=$100.
In cases when you need to include a third variable for calculation, you can use today's custom function. We're providing you with a sample script that you can adjust to fit your specific requirements.
Prerequisites:
1. Create a
Connection named "zbooks" to successfully execute the function. You can watch the GIF attached below to know how to create the connection.

2. Create the third variable (Days in this example) as an item-level custom field to be displayed in the sales transactions. You can check the GIF below for the steps.
3. Similarly, create another custom field called " Unit Rate" to be displayed in the item table. The purpose of this custom field is to store the original sales rate of the line item.
Custom Function:
Navigate to Settings -> Automation -> Custom Functions -> +New Custom Function > Add the function code from this
GitHub link.
Workflow Rule:
Go to Settings -> Automation -> Workflow Rules -> +New Workflow Rule and set up the workflow rule as shown below:-

In the final step of this workflow rule, associate the custom function you created and then hit Save.
Here's how the function will work:
The custom function will be executed once the invoice is saved. Initially, it copies the original sales rate to the Unit Rate (Custom) field. Then, it multiplies Days * Unit Rate and populates the result in the Rate (Default) field. Following this, Zoho Books performs the calculation of Rate (Default field) * Quantity and fills the result in the Amount field.
Note: If you wish to hide the "Rate" - default field at the template level, go to Settings > Templates > Invoices > Edit > Table > Disable the checkbox for Rate field > Save. Now the invoice templates will only display the Unit Rate (Custom field), Third variable field (Days), Quantity field, and their resultant in the Amount field.
Should you require any help in tailoring this function to better suit your requirements, don't hesitate to reach out to us at
support[at]zohobooks[dot]com. We will be happy to assist you!
Regards,
Shireen Farhana S
Zoho Books
Recent Topics
Moving to app-specific authentication for Google integrations
Hello everyone, We’re making an important change to how Google integrations work in our platform. Until now, we used a common Google project across Zoho to enable integrations like Google Drive, Calendar, and more. Going forward, we’ll be moving to an
Double opt-in notifications and customizable confirmation messages for your webforms
Dear CRM Community, We are excited to announce a major upgrade to our Webforms feature. You can now customize the confirmation message shown to your users who double opt-in from your webform and also customize your confirmation emails when they submit
Lost the ability to sort by ticket owner
Hi all, in the last week or so, we have lost the ability to sort tickets by Ticket Owner. Unlike the other columns which we can hover over and click on to sort, Ticket Owner is no longer clickable. Is it just us, or are other customers seeing this too?
Using a CRM Client Script Button to create a Books Invoice
Hello, I need help handling error messages returned to my client script from a function. The scenario I have setup a client script button which is available from each Deal. This CS executes a crm function, which in turn creates an invoice based on the
Zoho Desk - Custom Module Related List Columns on Tickets
I have a custom module in Zoho Desk called Asana Tasks, each task has a lookup to a Ticket. On the Ticket I want to see the columns of the Asana Tasks in the related list . Is there a way to do this? Right now it just has the name of the record and I
How to unlink a SAML user from the existing Zoho Desk user (domain change case)
Hi everyone, I’m trying to understand how to handle a situation where a customer changes their company domain. In our setup, users authenticate via SAML, so when the domain changes, the SAML system treats them as a new user. However, in Zoho Desk, I’d
Standalone custom function not generating logs
Why dont't standalone custom functions generate logs when the're called from another function? I have some functions (workflow, buttons and blueprint) that have common parts, so I put that part in a standalone function which is called from the others.
How Can i put a form in Zobot
Hi,how can i integrate a form which has a multiple options to choose from.the form should be opened or displayed by zobot after it meets a requirement in the conversation. Thanks in advance !
Has Anyone successfully integrated Zoho and Sage Intact?
Hey all, We’re evaluating Zoho One + Sage Intacct and I’m trying to connect with anyone who has actually implemented the two together.Specifically, I’d love to know: -- Which functions you kept in Zoho vs. Intacct (e.g., Product Catalog, AR/AP, invoicing,
Playback and Management Enhancements for Zoho Quartz Recordings
Hello Zoho Team, We hope you're all doing well. We would like to submit a feature request related to Zoho Quartz, the tool used to record and share browser sessions with Zoho Support. 🎯 Current Functionality As of now, Zoho Quartz allows users to record
Zoho Analytics - Feature Request For Time Based Data Source Fetch
Hi Analytics Team, I have a client using Zoho CRM and they want a weekly report at 4:30pm every Friday, emailed to the sales team showing a pie chart of Closed Won Deals for that week. This is easy to achieve in Analytics but not so easy to ensure the
Which user's capacity is used for Shared Mailbox storage?
We use shared mailboxes at our company, and their size is increasing daily. Which user(s)'s total mailbox limit is being used up by this space?
Migrate data from old to new account
Hy, Have one Old Zoho Notebook Account with Data , want to migrate that whole Data to New Zoho Notebook Account which is in Zoho One . Is that possible ? If Yes then how?
Campaign editor overrides href value
I've been trying to insert a deep link in an email campaign so recipients can directly open a native app on their device. My deep link looks something like "myapp://". The options to insert links in the campaign editor are limited to strict urls, emails,
Can't login IMAP suddenly
Since this evening I'm getting the error: You are yet to enable IMAP for your account. Please contact your administrator... IMAP always been enabled in my account and was workign fine for the past 7 years. Already tried turning IMAP off and on again.
Sending email notifications based on language
Hello. I would like to know how we can bypass the default notifications (which are just in English) for when a ticket is created/replied to/closed, to be in other languages, based on the language field in the ticket? I can create other email templates,
how to add subform over sigma in the CRM
my new module don't have any subform available any way to add this from sigma or from the crm
Zoho CRM - Option to create Follow-Up Task
When completing a Zoho CRM Task, it would be very helpful if there was an option to "Complete and Create Follow-Up Task" in the pop-up which appears. It could clone the task you are closing and then show it on the screen in edit mode, all the user would
Bug Report and Suggestions for Improvement in Zoho Applications
Hi Zoho Team, I’d like to report a few bugs and improvement suggestions I’ve noticed while using Zoho products: Zoho Cliq Video Call: The camera sometimes turns off automatically during video calls. This seems to be a bug — please check and fix it. Zoho
Super Admin Logging in as another User
How can a Super Admin login as another user. For example, I have a sales rep that is having issues with their Accounts and I want to view their Zoho Account with out having to do a GTM and sharing screens. Moderation Update (8th Aug 2025): We are working
Canvas Flex Box containers should not require a width/height.
Flexbox containers are often used as organizational concepts, to ease re-flow on mobile etc. - I cannot use % for flexbox W or H - I cannot omit W or H This means that the content cannot dictate, and a Flexbox container cannot be used merely as an organizational
Zoho Desk Android app update: Filter enhancement, Save Filters
Hello everyone! We have now enhanced the filter section on the ticket listing screen of Zoho Desk Android app as it is on the web(desk.zoho.com). Also, we have introduced an option to save filters for tickets on the mobile app. You can easily apply, rename,
Very long loading times | bad performance [ZOHO DC: EU]
Hello there, we have recently noticed that the loading times have become extremely long when retrieving tickets and ticket details. For example, I open any ticket and get the following view. The subject and standard information (ticket owner, status etc.)
How to add to Subforms via Zapier with Zoho Writer?
I have the following layout for a Zoho Writer Document. As you can see there is a repeating subform taking in "Items". I am trying to make a Zapier integration with it, and I can see there is 1 field saying: "Items", but it does not specify how I'm supposed
Zia Profile Summary now supports six languages and responds faster
After numerous customer requests, we’ve expanded Zia Profile Summary to do more than just summarize resumes quickly. It can now summarize them in six different languages and deliver results even faster. What’s New 1. Extended language support Zia can
Introducing Zoho Show Android 3.0
Good ideas need the right space to grow. They deserve tools that move as fast as your thoughts and make creating feel effortless. And that is why we are bringing you Zoho Show Android 3.0! From a brand-new look and smoother navigation to improved collaboration
Properly Capture Dropdowns & Hover Elements When Recording a Window/Tab
Hi Zoho WorkDrive Team, Hope you are doing great. We encountered a limitation when recording a selected window or browser tab: Certain UI elements, such as dropdown lists, hover menus, and overlays, are not captured unless we record the entire screen.
Peppol integration zoho invoicefu
Hi, Belgium will require Peppol invoicing as of 2026. I found that this is being prepared for Zoho books, to be released in Sep 2025. Will Zoho Invoice get this functionality too? I like the Invoice app for my part-time side business as bike mechanic
CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive
Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
Allow Recording Only a Selected Portion of the Screen
Hi Zoho WorkDrive Team, Hope you are doing well. We would like to request a more flexible recording option in Zoho WorkDrive. At the moment, we can record either the entire screen or a specific window/tab — but not a custom selected portion of the screen
Restricting Calendar View to Working Hours
Hi: I'm trying to implement a calendar which displays all of my customer appointments. Currently, the calendar shows all 24 hours of the day. Is there a way to restrict the hours to simply the times my business is open? Thanks!
Add Camera Background Blur During Recording
Hi Zoho WorkDrive Team, Hope everything is well. We would like to request an enhancement to the video recording feature in Zoho WorkDrive. Currently, the camera preview displayed during a recording does not support background blur. This is an essential
Amazon FBA integration - Handle invoice reconciliation under different GSTINs,
Dear Zoho Community, Thank you for the clarification regarding the Amazon FBA integration, default warehouse, and GSTIN mapping in Zoho Inventory. I understand that Zoho currently supports only one warehouse for Amazon FBA, and that all FBA orders are
Whatsapp Integration questions
Hi Questions: 1. Whatsapp messages are not reaching our CRM, is there a delay? 2. Is there any way to create a whatsapp catalog on a number that is integrated with ZOHO? 3. How do I configure my profile picture on a number that is integrated with ZO
Allow Font Size 11 in Editors...
That is basic functionality...
link mail.zoho.com/UnblockMe to unblock
Could you please unblock my account heloisa.bomfim@expansaodenegocios.com
Unblocked me
Please can you help unblocked my account thanks materiauxjcbrunet2000@zohomail.com
Archiving Contacts
How do I archive a list of contacts, or individual contacts?
Integrating External Portal Tickets Into Zoho Desk
A B2B travel company has a customer portal where clients can raise and submit tickets related to their bookings. These tickets need to be handled and managed in the backend through Zoho Desk. Ticket updates and replies from Zoho Desk should also be visible
Make Camera Overlay & Recording Controls Visible in All Screen-Sharing Options
Hi Zoho WorkDrive Team, Hope you are doing well. We would like to request an improvement to the screen-recording experience in Zoho WorkDrive. Current Limitation: At the moment the recording controls are visible only inside the Zoho WorkDrive tab. When
Next Page