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 

    Access your files securely from anywhere


            Zoho Developer Community




                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day



                                          Zoho Marketing Automation


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep Resources



                                                            Zoho CRM Plus Resources

                                                              Zoho Books Resources


                                                                Zoho Subscriptions Resources

                                                                  Zoho Projects Resources


                                                                    Zoho Sprints Resources


                                                                      Qntrl Resources


                                                                        Zoho Creator Resources



                                                                            Zoho CRM Resources

                                                                            • CRM Community Learning Series

                                                                              CRM Community Learning Series


                                                                            • Kaizen

                                                                              Kaizen

                                                                            • Functions

                                                                              Functions

                                                                            • Meetups

                                                                              Meetups

                                                                            • Kbase

                                                                              Kbase

                                                                            • Resources

                                                                              Resources

                                                                            • Digest

                                                                              Digest

                                                                            • CRM Marketplace

                                                                              CRM Marketplace

                                                                            • MVP Corner

                                                                              MVP Corner





                                                                                Design. Discuss. Deliver.

                                                                                Create visually engaging stories with Zoho Show.

                                                                                Get Started Now


                                                                                  Zoho Show Resources


                                                                                    Zoho Writer Writer

                                                                                    Get Started. Write Away!

                                                                                    Writer is a powerful online word processor, designed for collaborative work.

                                                                                      Zoho CRM コンテンツ






                                                                                        Nederlandse Hulpbronnen


                                                                                            ご検討中の方





                                                                                                  • Recent Topics

                                                                                                  • Deleted Blog Still Visible on Zoho Site

                                                                                                    I deleted the blog on the Zoho site and permanently removed it from the trash, but the article is still visible. Please make sure it does not appear. The URL is below https://seeds.tech-manage.co.jp/blogs/post/WL-04550
                                                                                                  • Tip of the week # 40 - Customize your sidebar for easier, more efficient inbox management.

                                                                                                    Is a cluttered sidebar slowing down your work and making it harder to focus on what’s important? Zoho TeamInbox allows you to customize your sidebar to fit your needs, making it easier to manage your shared inbox. You can temporarily hide thread views
                                                                                                  • INVALID_DATA Error While Setting Date Field in Client Script of Details Page

                                                                                                    I am trying to detect the Stage change on Details(Standard) page (with the stepper section), then update Stage_Updated_At (Date) field with today's date. Thanks to @Ishwarya SG 's direction, I found this topic and I managed the first part
                                                                                                  • Guidance on Making Zoho Desk Connections Available for All Data Centers

                                                                                                    Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
                                                                                                  • Changing Color Theme of Guided Conversations

                                                                                                    Hello, We have recently added Guided Conversations to one of our websites, but I am wondering if there is a way to customize the color scheme so it matches the appearance of the website? Thank you in advance!
                                                                                                  • Setting default From address when replying to request

                                                                                                    At the moment, if I want to reply to a request, the From field has three options, company@zohosupport.com, support@company.zohosupport.com, and support@company.com.  The first two are really internal address that should never be seen by the customer and
                                                                                                  • Home Page Layout Suddenly Changed; How to Remove Open Activities

                                                                                                    Hi, When I logged in yesterday, I noticed the Home Page layout was completely different. I'm using the Classic View. Suddenly there is a massive section of Open Activities that takes up the whole top half of my screen with My Tasks below it: Open Activities
                                                                                                  • ZOHO DESK link with Power BI

                                                                                                    HI, I am using ZOHO Desk for last two years and now my client is asking to integrate ZOHO desk data to Power BI so that they can use Data for reporting. Kindly guide in details so that i can give access to ZOHO desk export data for more visibility.
                                                                                                  • Writer Merge and Sign OAUTH API Call error.

                                                                                                    Trying to send a request to the Merge and Sign API. I keep getting "Merge data not found. Please try again with proper merge data." Request is sent via JS axios call. We use the same exact data inside a CRM function and everything works. Followed the
                                                                                                  • Open a report and filter it based on my current module selection

                                                                                                    I am looking to take a report that I have created and use a button in my custom module to open that report and have it filter down to the data from the account selected in the custom module.
                                                                                                  • Unlocking New Horizons: A Year in Review

                                                                                                    As we bid farewell to 2024, let's celebrate and revisit the key highlights of the year. From adding a new edition to cross-platform enhancements, here’s a roundup of all the feature updates designed to simplify accounting, optimize financial management,
                                                                                                  • Kaizen #121 : Customize List Views using Client Script

                                                                                                    Hello everyone! Welcome back to another interesting Kaizen post. In this post, we can discuss how to customize List Views using Client Script. This post will answer the questions Ability to remove public views by the super admin in the Zoho CRM and Is
                                                                                                  • Open Tickets

                                                                                                    Is it possible to get a notification if a ticket is left open for X amount of time? For instance, if a ticket is left open for 1 week, can I get an alert to follow up on the ticket and close it out if necessary? Thanks!
                                                                                                  • I want to know the gross profit by sales person. How?

                                                                                                    Kindly guide me how to know the amount of gross profit which is calculated on the basis of sales person. That means, how much is the amount of gross profit made by a particular sales person.
                                                                                                  • Shout out Canvas!

                                                                                                    If anyone has not used Canvas designs, please watch this video. The canvas team have been really amazing to help us get to this result. This makes training teams so much easier! I'd much rather build a canvas design than write user guide documentation.
                                                                                                  • Cases module mail merge

                                                                                                    Hi Guys  Is it possible to use fields from the cases module within the word mail merge ?  I dont see this option in the word mail merge application. Thanks  Chris 
                                                                                                  • Auto select template when "Send Email" button selected?

                                                                                                    I have created a template for Contacts, and I want to have that template auto open whenever the Send Email" button selected on a Contacts page. I know how to do this in Salesforce so I assume in Zoho it would require a custom button on the Contacts page
                                                                                                  • Limiting Knowledgebase Access To Logged In Users

                                                                                                    Hello, how can I restrict access to our Knowledgebase to only logged-in users? Our KB is not meant to be accessible to anyone. However, anyone can create a ticket. Thanks! Frank
                                                                                                  • API question - adding a thread to an existing ticket

                                                                                                    Hi Is there an API function for the customer to add to an existing ticket thread? example, customer puts in new support ticket. support replies and ask for more details. customer replies with more details -what api function is used for this (will add record append to same ticket number?) Thanks
                                                                                                  • Directly Edit, Filter, and Sort Subforms on the Details Page

                                                                                                    Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
                                                                                                  • Populating Lead ID in Deal Record

                                                                                                    I’m trying to create a unique identifier to match deal and lead reports, and my plan was to use the Lead ID as the key. However, I’m having trouble figuring out how to get the Lead ID from the lead record into the deal record during the lead conversion
                                                                                                  • Attach image from Creator Subform to Deal

                                                                                                    Can anyone help me figure out how to attach an image from a creator subform to a Deal? I have read through all of the documentation and can't find anything for my specific scenario. Everything I have found is attached from the Creator form (not subform)
                                                                                                  • Can't sign in to Zoho using Google account

                                                                                                    Just checking if anyone else has an issue signing into Zoho with a Google account at the moment? (Have tried Zoho Books in the app on mobile and Chrome and Firefox on Windows 10 - doesn't work for the forums either). Error message appears as attache
                                                                                                  • Chat Widget Does not appear for users

                                                                                                    The chat icon appears for some users, and not all. I know our integration is set up correctly because of the fact that some users can see and use it. I also cannot provide a link to our website for security purposes. But we need a resolution to this as
                                                                                                  • Multi-Sort Functionality, Projects List

                                                                                                    It is proving so hard for us to manage any kind of decent view into our Active list of projects (which now hovers between 150 and 225 at a time).  In addition to my other suggestion here (which hasn't had any activity in a year), I'd like to suggest that
                                                                                                  • Email Alerts for Schedule Failures in Zoho CRM

                                                                                                    Hi, I hope this message finds you well. Currently, when a schedule fails, there is no automated way to notify us via email about the failure. This makes it difficult to promptly address the issue as it requires manual monitoring to identify and resolve
                                                                                                  • Questions about file size limits

                                                                                                    I'm looking at the limits published on this article: https://help.zoho.com/portal/en/kb/zoho-learn/general-1/image-and-file-sizes/articles/file-upload-sizes#Knowledge_module. I want to clarify my understanding of the limits. 1) Example: if my course has
                                                                                                  • Time field is empty text in pivot chart report

                                                                                                    Hello all, I am currently trying to create a pivot chart, where the y-axis is supposed to be a total sum of time. The problem Im facing however is actually using the field, where my metric is stored. It shows up as a simple time field in the form builder.
                                                                                                  • Creating Packages

                                                                                                    Hi I am trying to create a database for my company. I need to create packages from individual products. I have added products ie item 1, item 2 and item 3 I need to create a package where Package A will have items 1 and 3 Lookup only adds one product
                                                                                                  • Do workflow stop working when developing user is deactivated ?

                                                                                                    Hi, I have an interesting question of one of my colleague. In Creator, we have this colleague (normal zoho user, not developer) who is developing Forms, Workflows, and Connectors in Creator. When this user gets deactivated, ae connectors and workflow
                                                                                                  • Where do I get/create the API Key for my zoho app to talk to zoho calendar

                                                                                                    So I manage to cobble some code together, but how I sort out the API side things to get the app and zoho calendar to communicate with each other.
                                                                                                  • Phone Number Format Change - Bulk Add Country Code and Remove Dashes

                                                                                                    In the past I would create a new customer in my Zoho Books, and enter their phone number in the format customary for the USA (that's where we are domiciled): Areacode-Prefix-Number 234-456-6789 This scheme is important as many other software packages
                                                                                                  • Can't send emails to gmail accounts

                                                                                                    Hi there, My Zoho email is not allowing me to send emails to clients with gmail addresses. Sometimes it'll work on the second try, but sometimes it takes multiple tries to get through. What can I do?
                                                                                                  • Help upgrading from Zoho Workplace

                                                                                                    Is anyone able to assist with upgrading from Zoho Workplace to Zoho One? There appears to be no clear upgrade path. Thanks.
                                                                                                  • 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.
                                                                                                  • Add Action to Remove/Delete Users in Jira

                                                                                                    Hi, I hope you’re doing well. I noticed that Zoho Flow currently allows the creation of users in Jira, which is great. However, there is no option to remove or delete users from Jira through Zoho Flow. This limitation can be challenging when managing
                                                                                                  • DELETE EU VAT ID FORM MY ACTUAL INVOICE ADDRESS FROM MY ACCOUNT

                                                                                                    WE NEED TO DELETE (NOT CHANGE) THE EU VAT ID FROM OUR INVOICE ADDRESS. WHEN WE TRY TO LEFT IT BLANNK, AGAIN SAVE THE OLD EU VAT ID. YOU ARE SENDING US FALSE INVOICES WITH FALSE DATA
                                                                                                  • How to add medical insurance benefit for an S-Corp more-than-2% owner?

                                                                                                    I have an S-Corp owner who is also the sole employee. They are going to run health insurance through their business, which means it needs to be logged as a benefit to them as an employee, but as an S-Corp more-than-2% owner, the value of the health insurance
                                                                                                  • Connecting Zoho Inventory to ShipStation

                                                                                                    we are looking for someone to help connect via API shipStation with Zoho inventory. Any ideas? Thanks. Uri
                                                                                                  • Introducing Social Toolkit

                                                                                                    Hi everyone, We're thrilled to launch Social Toolkit, a one-stop dashboard to help take your social media presence to new levels by letting you create aesthetic profiles and share content that your audience will actually enjoy engaging with. Social Toolkit
                                                                                                  • Next Page