Function #57: Automatically group items in invoices based on categories

Function #57: Automatically group items in invoices based on categories



Hello everyone, and welcome back to our series!

As a business expands and new product lines are launched, it becomes important to organize the items for better inventory management. The Category field in Zoho Books helps here by allowing you to add and assign categories to group items effectively. You can even create sub-categories under a parent category for more specific organization. The Sales By Category report provides insights into the performance of each category, helping you make informed business decisions. Today's function revolves around this Category field. It aims to automatically sort items added to an invoice based on their categories and display the category names as headers. 



Consider Mr. John Hector, who runs a wholesale stationery shop. When a customer orders various items such as pens, paints, paint brushes, color palettes, and desk supplies from different categories, John raises an invoice in Zoho Books to record the sale. Once the invoice is saved, the custom function is executed to organize the items by their categories and add the category names as headers. For example, items related to art—like paints, paint brushes, and color palettes—are grouped under "Art Supplies." Similarly, other items will be grouped under their respective category headers, and any uncategorized items will be listed under the header "Others". This organized layout helps both John and his customers easily understand the assortment of items on the invoice. 



Note: The Category field will be accessible in Zoho Books after enabling the Zoho Inventory add-ons

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. To enable the "Category" field, go to Zoho Books > Items > Field Customization > Hover over the Category field > Click on the dropdown menu and select "Mark as Active".



Custom Function:

Navigate to Settings -> Automation -> Workflow Actions -> Custom Functions -> +New Custom Function > Add the function code from this GitHub link -> Save. 

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.

If you need assistance with implementing this function, please contact our Support team at
support[at]zohobooks[dot]com. We are happy to help.

Regards,
Shireen Farhana
Zoho Books 

    • Recent Topics

    • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ(1/30)

      ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 1月開催のZoho ワークアウトについてお知らせします。 登録フォーム:https://us02web.zoom.us/meeting/register/nLdH2Q2JRIm2Mm3TQ7W5eQ ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho ワークアウト」を開催します。 Zoho サービスで完了させたい設定やカスタマイズ、環境の整備など……各自で決めた目標達成に向け、
    • How to link Custom Fields in Ticket view

      Hi team, I have created 2 custom fields in our Accounts Module would like them to show in our ticket information. We don't have Enterprise so I cannot do it via a workflow, but I know you can do lookup fields to link modules. How would I go about making
    • Mapping for date field from one module to another.

      Hi there, I want to be able to map a date field(due date) in a module (sales order) to another module's(Purchase Requisition) date field(Promised customer date). Is this possible when the due date field is a zoho system date field while the promised customer
    • Can I use merge tags with a conditional clause?

      Similar to Mailchimp's "IF / ELSE / ENDIF" functionality, I want to be able to display a sentence with a personalised field only if that merge tag is not empty for the given record. Is this possible on Zoho Campaigns? See http://kb.mailchimp.com/article/how-do-conditional-smart-merge-tags-work for how it works on Mailchimp. Thanks Phil
    • This mobile number has been marked spam. Please contact support.

      Hi Support, Can you tell me why number was marked as spam. I have having difficult to add my number as you keep requesting i must use it. My number is +63....163 Or is Zoho company excluding Philippines from their services?
    • Telephony External ID field added in CRM

      Dear All, We have an enhancement for users with telephony integrations—introducing the Telephony External ID field. Let's get into the details! What is an external ID field for telephony? External ID fields in Zoho CRM essentially hold a record's reference
    • Error AS101 when adding new email alias

      Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
    • domain authentification on ovh and zoho

      I don't succeed in adding an domain authentification on ovh. Should i first create a subdomain? But this doesn't work either, ti gi ves te same screen and the next button is greyed out when adding the info received from zoho
    • Splitting a List into different rows

      I am getting a List from a for each loop. But I can't figure out how to separate each item that is separated by a comma. Example Zone 1 - Front Door,Zone 2 - Rear Door,Zone 3 - Side Door I need it too look like this: Zone 1 - Front Door Zone 2 - Rear
    • Zoho Desk iOS app update- Save drafts on the social channel tickets, send replies via blueprint transition on social tickets

      Hello everyone! In the latest iOS version(v2.9.3) of the Zoho Desk app, we have brought in support for the following features: Save drafts on social tickets Send replies to social tickets via blueprint transition. Save drafts on social tickets We can
    • Unit Conversion with Unit of Measurements for Items, has anyone successfully figured this out????

      I am currently using google sheets to break down my per cost of items I buy in bulk. We are a non-profit that creates kits and resells at the exact price we pay for the items to our customers or uses grants from the government to pay for them. I can not
    • Possible for client users to use timesheets?

      Hello, We are setting up a project where the bulk of development will be performed by subcontractors. We were thinking of setting them up as client users to have access to project information resources. Is it possible for a client user to log time against
    • Automation in Zoho Sprints

      Hi. I have a Sprints board with the following statuses: ToDo, InProgress, CodeReview, Testing, Preprod, Live When a ticket is moved from e.g. Testing to Preprod, the following tags should be modified: remove 'tested OK' remove 'ready for Preprod' add
    • Zoho Flow reads record Tag as number instead of text string. How do I change it?

      I have experience with flow and have a number of them working. This flow is supposed to add a record in a custom module when a Contact record is edited or created with a specific tag. Trigger criteria is "Tag contains 'Athlete' ". However, the flow does
    • Oops! Something went wrong. Try again later When trying to send email

      Hi, This error is appearing everytime i am trying to send an email. Oops! Something went wrong. Try again later  Please help.
    • How to Parse XML Data Returned by API?

      I have several APIs integrated with my CRM and they work great. I am having some trouble though parsing data out of a large string/array in Funtions? I need to be able to pull the DeviceId and the WebSiteDeviceName from each PanelDevice. I would appreciate
    • Deluge Script - "Mismatch of data type expression" Error When Retrieving Account ID

      Hi everyone, I'm working on a Deluge Script in Zoho Creator to create Accounts and Locations. I'm running into a "Mismatch of data type expression" error when trying to retrieve the ID of a newly created Account. Here's the relevant part of my code: accountResponse
    • Function Only Working Manually

      Good evening everyone. I have a function that creates a PDF from a Creator form. When I execute it manually it works perfectly. But when I execute it from within a On success workflow it is not working. I'll post my code below. Any ideas? //Function void
    • Elevating Email Security on Zoho Desk: DKIM Now Mandatory

      Hello Zoho Desk Users! It has been a wonderful journey with you on Zoho Desk. As we welcome 2025, we are strengthening our efforts to ensure a secure and seamless experience for you. To enhance email security, DKIM configuration will be mandatory for
    • Assistance with Code to send email on subform data

      I am trying to trigger an action off the successful submission of a form that emails the details of the subform to a distinct email. This subform is setup as another form in the app and I can get the below code to work: for each subrow in input.New_Payment_Subform
    • PDF Import

      Hi Guys, Zoho Sheet now supports file formats such as XLSX, XLS, XLSM, ODS, CSV, TSV, SXC, XLTX, and TXT. However, support for PDF files is not available yet. Adding this option would be very helpful. Thank you!
    • Credit Card Terminal for Zoho Books

      Hello, Instead of punching the credit card number manually for customer payment, do you have a third-party hardware credit card reader that works with Braintree? Thank You
    • Zoho CRM Workflow Merge Tag For a File Upload

      Hello, is there anyway to add a merge tag for a file upload field in Zoho CRM Workflow emails? I don't see it as an option in the drop down. Thanks, Hannah
    • Shared Mailbox - Mark as read for all users

      Hi all, Maybe someone can help me out. At the moment we have a shared mailbox without streams. When a users reads an mail or marks it as read other users will not see this. How can we resolve this? We now archive the mails when read and followed up. However
    • How to delete attachments form Zoho mail accounts

      I can't find a way to delete attachments from Zoho mail messages, either individually or in bulk. Searches here are providing conflicting results and often talk about workspace, whereas I am only interested in how to delete attachments that are seen with
    • Stopped getting zoho notifications in Email for Customer response to support tickets

      Hello , I stopped receiving Notifications from customer response in my company with attached to this account.
    • ChatGPT

      Hola, sabéis si además de tener la licencia de chat GPT Plus hay que comprar créditos para usar chat GPT en zoho social? Gracias
    • ZOho Recruit API hiring Pipeline

      I was wondering if it's possible to update the hiring pipeline using the API. I am messing around and I can change the status of the applications and it shows the application as rejected but the pipeline stay's at the stage that applicant was at. Also
    • 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?
    • Round-Robin with Load Based Assignment, can you limit which Status are considered?

      Hello, We are currently using Round-Robin with Load Base Assignment. Is there a way to exclude tickets of a certain Status from being considered by the Round-Robin Assignment rules? For example... I have the following statuses. Escalation Review (meaning
    • Notify on new comment

      I would like to notify users when a new comment is added to ticket/request? So if someone is following request they would get email or text saying that comment has been added to this request. Or request/ticket owner get notified. Thanks Luis
    • Save Draft in email bigin for desktop and mobile

      Hi any news to when we going to have the save draft for email in bigin desktop and mobile?
    • Insufficient "previlleges" to perform this operation? All of a sudden

      Trying to create a ticket report in the free version of Zoho Desk (Analytics > tickets by contact), same as I have always done for the past 4 years every 2 weeks, and I am receiving the following message: I am labeled as Support Administrator, and we
    • Ticket sends email to 2 different email addresses

      Good afternoon, I am attempting to setup our ticketing system so that when a ticket is created, updated, and closed, it will email both the customer receiving support as well as the salesperson that is associated with the customer. The way that our tickets
    • API to post drafts for social media

      I we want to post draft posts to our zoho social account and then approve and schedule them within Zoho social. is this possible with for example: https://apis.zoho.com/social/v2/post TIA Jon
    • Forced Tooltip on Maps View

      Please remove the forced tool tip data points and ONLY include those listed in the "Include Columns for Tooltip" area. Also, disable the tool tip if no fields in there. With a lat/lng map, it forces showing those (and color field, lat count) and will
    • Anyone else having trouble with blurry pixelated screenshare?

      Ever since Monday Nov 26th., Cliq and Meeting screenshare has been blurry/pixelated like this:  https://www.screencast.com/t/0CblL3drKuU Did something change? Because Our Internet connects are plenty fast and everything is crystal clear in Skype... Also, video share is clear and normal, it is just screen share... Thanks
    • Map chart on Dashboard - can I disable tooltip?

      When adding a world map chart to a dashboard, I would like to disable the tooltip with details. Is there a way to do that?
    • ERROR

      I deleted a contact card, I want to add it again but it says that the contact already exists. I searched the records and it is not there, and I even deleted it in the trash. The email is this one: ldurbani@gmail.com. Please help!!
    • Currency Field Does Not show commas upon entry - leading to inaccurate entries!

      Hello Zoho... When our sales reps are entering deals and the profit/revenue it is difficult to accurately enter numbers with lots of zeros when there commas are NOT added until the record is saved. Could commas be added to this filed type as it is being
    • Next Page