Power of Automation :: Auto-Color Tasks in Gantt chart based on values in Picklist field.

Power of Automation :: Auto-Color Tasks in Gantt chart based on values in Picklist field.

Hello Everyone,

A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it.

Requirement:-

One of our customers wanted to dynamically update the Task colors in the Gantt chart based on the value selected in the Picklist custom field called Approval Status Picklist. This can be achieved using Task Custom Functions along with Workflow rules in Zoho Projects. 

For instance, when the value "Design" is selected in the picklist, the corresponding task in the Gantt chart should automatically be updated to "Green" color.

Below are the values and color code mapping used in the sample custom function code. However, you can customize these mappings to suit your requirement. 

Values
Task colors
Design
Green
Wait 
Grey
Assembly
Yellow
Test 
Red
Meeting 
Blue

Custom function code:-

if(process.equals("Design")) {
color = "rgb(0, 255, 0)"; //Green
} else if(process.equals("Wait")) {
color = "rgb(124, 124, 124)"; //Grey
} else if(process.equals("Assembly")) {
color = "rgb(255, 255, 0)"; //Yellow
} else if(process.equals("Test")) {
color = "rgb(255, 0, 0)"; //Red
} else if(process.equals("Meeting")) {
color = "rgb(0, 0, 255)"; //Blue
}
changeColor = invokeurl
[
url: endPoint + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/taskcolor/"
type: POST
parameters: {"color":color}
connection: "XXXXX"
];
info changeColor;
return "success";

Ensure to replace XXXXX with the Zoho Projects connection link name, along with the scope ZohoProjects.tasks.UPDATE. Check this link to learn how to create the connection. Please find the screenshot of the parameters to be mapped. 

We hope you found this post useful. If you have any questions, feel free to share them in the comments below.
 

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Customize User Invites with Invitation Templates

            Invitation Templates help streamline the invitation process by allowing users to create customized email formats instead of sending a one-size-fits-all email. Different invitation templates can be created for portal users and client users to align with
          • Sandbox - Your Secure Testing Space in Zoho Projects

            Managing projects often involves fine-tuning processes, setting up new automations, or making configuration changes. Making changes directly in a live environment can disrupt production as it does not leave room for trial and error. Sandbox in Zoho Projects
          • One Place for All Your Automation Needs

            All automation settings are grouped under Settings ()> Automation. This helps you find everything related to automation from one place. Under Workflow Rules, Email Alerts, Email Templates, and Webhooks: Use the Projects tab for project-specific settings.
          • Introducing Version-3 APIs - Explore New APIs & Enhancements

            Happy to announce the release of Version 3 (V3) APIs with an easy to use interface, new APIs, and more examples to help you understand and access the APIs better. V3 APIs can be accessed through our new link, where you can explore our complete documentation,
          • Zoho Projects - Quarterly Updates | Q1 2025

            Hello Users, We would like to share the latest updates for this quarter. Here is a round-up of the features and enhancements we rolled out in Q1: Working with Zoho Projects data in Power BI? Integrate Zoho Projects to Power BI and sync module data (from

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • Full Text Customization & Translation in SalesIQ Chat Widget Settings

                                    Dear Zoho SalesIQ Team, Greetings, We would like to request an important enhancement to the chat widget customization options in Zoho SalesIQ. Current Limitation: At the moment, only some of the text shown in the chat widget is editable or translatable
                                  • Copy Sales Order Reference# to Purchase Order#

                                    Hello, We use our customer's purchase order number as the order number on our purchase order to the supplier.  We direct ship everything from our suppliers and the customers then see their PO number on the packing notes (instead of a sequentially-generated one). Therefore, is it possible to use automation to copy the Sales Order Reference# (customer PO) to the respective Purchase Order# (our PO) when converting the Sales Order to a Purchase Order?
                                  • Experience effortless record management in CRM For Everyone with the all-new Grid View!

                                    Hello Everyone, Hope you are well! As part of our ongoing series of feature announcements for Zoho CRM For Everyone, we’re excited to bring you another type of module view : Grid View. In addition to Kanban view, List view, Canvas view, Chart view and
                                  • Free webinar: Zoho Sign in Q2 2025: A quick walkthrough

                                    Hi there! We’re halfway through the year—and Zoho Sign has some exciting enhancements to show for it! Join us in our upcoming webinar to discover what's new and what you can look forward to. What will this session cover? Explore the newest features introduced
                                  • Upcoming Changes to LinkedIn Parsing in Resume Extractor

                                    Starting 31 July 2025, the Zoho Recruit Resume Extractor will no longer support direct parsing of candidate data from LinkedIn profiles. Why Is This Change Needed? In accordance with LinkedIn’s platform policies, extracting profile data through browser
                                  • Copying records from a Custom Module into Deals

                                    Hello, I recently created a custom module to handle a particular type of order/transaction in our business. Having got this up and running I've realised that it would be much better to use the Deals module with a different layout instead. We've entered
                                  • Using a Webhook as an Action

                                    I have been able to setup where I can use a webhook as a Trigger, but I am wondering how I can use a webhook as an Action. In the Zoho Flow Builder when using Zoho CRM as a trigger, I do not see a way to invoke a URL to POST json data that can be used
                                  • Marketer’s Space - WhatsApp Pricing Update: What Marketers Need to Know and Do

                                    Hello Marketers, Welcome back to Marketer’s Space! WhatsApp made changes to their pricing model on July 1, 2025, moving from conversation-based pricing to a per-message pricing model. This week’s post focuses on what these changes mean for your WhatsApp
                                  • Add Microsoft Entra ID to Zoho One

                                    Hi! Have anyone tried the Zoho connection to Microsoft Entra ID (https://help.zoho.com/portal/en/kb/one/admin-guide/directory-stores/articles/add-microsoft-azure-to-zoho-one?action=kbArticleFollow&actionId=4014605732522 ) This is a big operation and you
                                  • Using Zoho One to manage two (or more) businesses

                                    We are one company that operates two business, a scenario that Zoho One doesn't really seem to handle very well, and one which I can't imagine is at all unique to us! (It is basically designed to facilitate branding and use for one business only per subscription).
                                  • Subform edits don't appear in parent record timeline?

                                    Is it possible to have subform edits (like add row/delete row) appear in the Timeline for parent records? A user can edit a record, only edit the subform, and it doesn't appear in the timeline. Is there a workaround or way that we can show when a user
                                  • Kaizen #197: Frequently Asked Questions on GraphQL APIs

                                    🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                  • Pushing Zoho People leave into Microsoft calendar: how to chose how "event" is shown (busy, free etc)

                                    Hi, how can I select how a "leave" event is pushed into Microsoft calendar? I want for leave "working elsewhere" to show as working elsewhere and NOT as busy.
                                  • Is there any way to prevent the row cloning feature(on edit page)

                                    My initial requirement is to prevent some users from adding new rows in the subform. For that, I have implemented the client script, and the script is working fine. But users are able to clone the row and make changes. For that, I was unable to find any
                                  • Custom Bulk Select Button

                                    Zoho CRM offers the ability to select multiple records and invoke a Custom Button This functionality is missing from Recruit Currently we can only add buttons in the detail page and list But we cannot select Multiple Records and invoke a function with
                                  • Tiktok and Instagram Carousel with Music

                                    Is it possible to add music or sound (can be downloaded or uploaded or attached) when we upload carousels in IG and Tiktok?
                                  • Once again, non-admins can no longer revise the site map

                                    Not sure when this change happened, but it's a problem now. This appears to be a regression on this issue: https://help.zoho.com/portal/en/community/topic/bug-non-admins-can-no-longer-revise-the-site-map ... which was solved. That issue was also a regression.
                                  • How to add Leave Type Permission Start Time

                                    Hi, I have a requirement to add Leave Type : Permission Start Time on the email template to which is end to the reporting manager. But I am unable to find the field in the list of fields. How to achieve this?
                                  • Modifying Product Details

                                    I am in the process of setting up new products in Zoho Commerce and have encountered a few problems: 1) Tabs It seems that Product Details pages do not have the ability to create Tabs. eg:  https://www.thedebugstore.com/tp240141-aardvark-usb-i2c-spi-host-adapter-total-phase.html
                                  • Customer Addresses cannot be edited/deleted in invoices

                                    In the invoices we have an option to change the customer address and add a new address Now I dont know why for some reason if we add an address through this field, the address doesn't appear in the customer module We cannot delete the addresses added
                                  • Currency transition

                                    We are using Zoho CRM in Curacao, Dutch Caribbean. Our currency is currently the ANG. Curacao will be transition ing from using the ANG (Antillean Guilder) to using the XCG currency (Caribbean Guilder) on March 31st 2025, see: https://www.mcb-bank.com/caribbean-guilder.
                                  • Detail View in Mobile without Labels

                                    Zoho creator 6. I have been trying to acheieve this but not able to. I have a quick view of my articles using custom layout for mobile. When i tap on an article it opens in detail view on my mobile which has two cols. Left displays label and right the
                                  • How do I automatically assign the project owner for all tasks in Zoho Projects?

                                    I have been researching for days on how to automatically assign all the tasks to the project owner on creation of the project in Zoho Projects. I have been having to go in and manually change all the task owner from 'unassigned' to the owner of the project
                                  • Updating task using excel file

                                    Hi, Is there a way to update existing tasks using excel file import?  Thanks
                                  • Zoho Books | Product updates | July 2025

                                    Hello users, We’ve rolled out new features and enhancements in Zoho Books. From plan-based trials to the option to mark PDF templates as inactive, explore the updates designed to enhance your bookkeeping experience. Introducing Plan Based Trials in Zoho
                                  • Cross module filtering is now supported in CRM

                                    Editions: All DCs: All Release plan: This enhancement is being released in phases. It is now available in AU, JP, and CN DCs. Help resource: Advanced filters The Cross-module filtering enhancement is now available to all CRM accounts in the following
                                  • Client Script Quality of Life Improvements #1

                                    Since I'm doing quite a bit of client scripting, I wanted to advise the Zoho Dev teams about some items I have found in client script that could be improved upon. A lot of these are minor, but I feel are important none-the-less. Show Error on Subform
                                  • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

                                    Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
                                  • Before Going To The Qc stage , site ready ness file upload mandtoty how to achive this in the blue print transition

                                    Before Going To The Qc stage , site ready ness file upload mandtoty how to achive this in the blue print transition On click of the Predelivery transition can we show site ready ness file upload mandtoty or on click of the QC show the alert message site
                                  • Note cards are duplicating

                                    Hi, I've been using this app for some time and love it. Recently I've noticed that upon closing a note card, it creates a duplicate. If I exit the notebook it's in and go back, everything is back to normal. Not a major issue but still a little annoying.
                                  • Where is the (Bulk) Notes Export function from Notebook ???????

                                    I have seen various threads over the last two years on this and basically no action from ZOHO at all ! BTW having to go to an individual note and export to PDF (which now doesn't even work ) or some sort of zoho format is by no means the answer ! I still can't see any sort of bulk (or even individual) export function across notes. This is really poor for a notes product that is nearly 4 years old from a "major vendor".  I now have a large number of notes (some with images) that I want to export and
                                  • Again about the backlighting of the search query when searching in a client for Linux

                                    Some time passed, I installed a client for Linux version 3.4.0, but I still did not receive the promised search with the backlighting of the search query how it was implemented in the client for android. In the previous topic, you told me that this function
                                  • Enhancements to finance suite integrations

                                    Update: Based on your feedback, we’ve updated the capabilities for integration users. In addition to the Estimates module, they can now create, view, and edit records in all the finance modules including Sales Order, Invoices, Purchase Order. We're also
                                  • Add views to new CRM UI navigation + Unlimited Webtabs

                                    Zoho CRM is so close now to being the ultimate business application with the new UI, as soon as this one feature is added. This is probably where Zoho is headed but if it's not I want to BEG for this to be incorporated. What we need is to be able to put
                                  • Important! ZipRecruiter Sponsored Posting Plan Changes in Zoho Recruit

                                    Greetings, We’re reaching out to inform you about an important upcoming change to the ZipRecruiter Sponsored job board integration within Zoho Recruit. What’s Changing? Starting June 1, 2025, Zoho Recruit will be updated with ZipRecruiter's latest pricing
                                  • Zoho Mail not working

                                    Anyone else had the issue where emails wont send from either the desktop CRM or the mail app? It just says "syncing" then "failed". I deleted it and tried to access emails through the CRM on my phone (fold) but they dont show. It seems it is impossible
                                  • Zoho Commerce B2B

                                    Hello, I have signed up for a Zoho Commerce B2B product demo but it's not clear to me how the B2B experience would look for my customers, in a couple of ways. 1) Some of my customers are on terms and some pay upfront with credit card. How do I hide/show
                                  • Flex Your Creativity – A New component to Canvas in Zoho CRM

                                    Hello Everyone We’re excited to introduce Flex, a new component for Canvas in Zoho CRM! Flex is here to give you greater control over how your data is displayed in your layouts. This component enables responsive layouts that adapt across different screen
                                  • In the Blue Print Transition requirement received it will show 8 check field in pop up if they any one of this field then only move to next stage Ist quote

                                    In the Blue Print Transition requirement received it will show 8 check field in pop up if they any one of this field then only move to next stage Ist quote Pls help how i fix this
                                  • Linking Multi-UOM Barcodes to Products in Zoho Books

                                    Greetings, I'm using Zoho Books for retail shop and I'm running into a bit of a challenge with products that have multiple Units of Measurement (UOMs) and corresponding barcodes. For example, I sell cigarettes both as individual packets and in cartons
                                  • Next Page