Function #42: Organize Contacts based on the Deal Stages

Function #42: Organize Contacts based on the Deal Stages



Welcome back everyone!

Last week's function was about updating subform records in two accounts simultaneously whenever one of them is updated. This week, it's going to be about displaying the Deal stages as "tags" in the Contacts records.

Business scenario

We all have our own ways of categorizing stuff. Lets say, you have a bunch of novels and you categorize them based on the genre, like "Action & Adventure", "Fantasy" or "Thriller". All of them are placed under a "Book Shelf" with separate sections for each of the genre. In CRM parlance, "Book Shelf" is the "Module" and individual sections for each genre are the "Tags". Essentially, you can group together records from a specific CRM module and place them under tags.

Functions help you relate records across modules. How about using tags to associate record properties from other modules within a record? For instance, adding the Deal Stages like "Qualification", "Needs Analysis", "Proposal/Price Quote", "Negotiation/Review", "Closed Won", etc. as tags for associated Contact records. This week's Function helps you do just that.

As a result, if a Contact is associated with the deal, it is placed under the tag with the corresponding Deal Stage. Ex: if a deal associated with a Contact is in "Negotiation/Review" stage, the contact record is placed under the "Negotiation/Review" tag in the Contacts module. Include tags columns in the default/custom view of Contacts module to track the associated deal stage.

Pre-requisites

  • Create Tags under the Contacts module with names from Deal Stages. Like "Qualification", etc.

Getting started with the function

  1. Go to Setup > Automation > Actions > Functions > Configure Function > Write your own.
  2. Provide a name for the function. For example: "Deal Stage as Tag in Contacts". Add a description (optional).
  3. Copy the code given below.
  4. Click “Edit arguments”.
  5. Enter the name as “contId” and select the value as "Contact Id".
  6. Click Save&Execute Script to check the code.
  7. Save the function.

The Code

-----------------------------------------------------------------------------------------------------------------------

headermap = Map();
headermap.put("Authorization","xxxxxxxxxxxxxxxx");
mp = Map();
mp.put("tag_names",input.stage);
response = invokeurl
[
url :"https://www.zohoapis.com/crm/v2/Contacts/" + contId + "/actions/add_tags?"
type :POST
parameters:mp
headers:headermap
];
info response;

-----------------------------------------------------------------------------------------------------------------------

Note

  • The code given above works only for V2 version of Zoho APIs. Please note that the code WILL NOT work for Version 1.0 APIs.

Found this useful? Try it out and let me know how it works! If you have questions, do not hesitate to ask! Do check out other functions shared in this series here.

See you all next week with another interesting function. Ciao!






                            Zoho Desk Resources

                            • Desk Community Learning Series


                            • Digest


                            • Functions


                            • Meetups


                            • Kbase


                            • Resources


                            • Glossary


                            • Desk Marketplace


                            • MVP Corner


                            • Word of the Day



                                Zoho Marketing Automation
                                        • Sticky Posts

                                        • ZUG (Zoho User Group) In-person Meetups - Learn, Share, and Discuss All Things Zoho

                                          Hi, We hope you are all doing well. We are excited to announce the second leg of our in-person Zoho User Group (ZUG) meetups in your region. A quick update: Our first leg of meetups in 2024 reached completion, and Zoho experts had the opportunity to meet
                                        • Tip #35 - On using Kanban View in Zoho CRM

                                          Hi folks,  It's that time of the week again, and I am back with a quick tip about using Kanban View in Zoho CRM. If you think you missed any of our previous weeks' tips, you can read them here.  Tip #35 - On using Kanban View in Zoho CRM You deal with so many records in CRM every single day! When you click open each module in Zoho CRM, you have hundreds of records, each in various stages of your sales pipeline. Wouldn't it be cool if you had them all sorted automatically without having to filter
                                        • ZUG (Zoho User Group) In-person Meetups - Learn, share and discuss all things Zoho

                                          Hi, Hope you all are well. We're excited to announce our second leg of in-person Zoho User Group (ZUG) meetups in your region. A quick update - Our first leg of meetups in 2024 progressed and reached completion smoothly, where Zoho experts had the opportunity
                                        • ZUG (Zoho User Group) In-person Meetups - Learn, share and discuss all things Zoho

                                          A big warm hello to the Zoho Community, and Happy new year to all of you! We're thrilled to let you know that our ZUG Meetups for 2024 have almost begun, and we can't wait for you to be a part of them. We have some interesting topics in store for this
                                        • Cloning Email Templates across modules in Zoho CRM.

                                          The option of cloning email templates across modules has been a long standing feature request from the Community. Thank you all for being so patient with us. We are happy to inform you all that this enhancement has been rolled out. Just in case you haven't noticed it already, cloning email templates is possible now! Cloning is useful because it cuts down the hassle of having to create the same email templates again for different modules. Here are the steps: Navigate to Settings---> Customization--->Templates


                                        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 WorkDrive Resources



                                                                  Zoho Campaigns 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

                                                                    





                                                                    




                                                                        Design. Discuss. Deliver.

                                                                        Create visually engaging stories with Zoho Show.

                                                                        Get Started Now