Adding Same-Email Contacts to Multiple Segments via Zoho CRM in Zoho MA

Adding Same-Email Contacts to Multiple Segments via Zoho CRM in Zoho Marketing Automation

Adding a Single Record to Multiple Marketing Automation Segments From Zoho CRM Using Custom Function and Checkbox Fields:


Alert

Business Context & Limitations 

This solution is best suited for businesses that :
  1. Manage a relatively small product catalog, as the approach depends on creating individual checkbox fields for each product in Zoho CRM and Zoho Marketing Automation. Therefore, the number of available custom checkbox fields in both CRM and MA must be sufficient to accommodate one checkbox per product.

  2. Use Zoho CRM to create and track individual records for each product purchase made by a customer (i.e., one record per purchase) to ensure detailed tracking of purchase history.

  3. Rely on Zoho Marketing Automation (MA) to deliver product-specific marketing campaigns. Segments are created in Zoho MA for each product, and contacts are added to relevant segments based on their purchase history.

  4. Utilise the native integration between Zoho CRM and Zoho MA to synchronise data. The setup ensures that consolidated purchase data in a single Zoho CRM record (via checkbox fields) allows a contact to be included in multiple Zoho MA segments and receive all relevant product-specific campaigns.



The Problem:

As per the current flow of Zoho Marketing Automation’s (MA) native integration with Zoho CRM, only one record per unique email address can be synced to MA. Even if multiple records exist in Zoho CRM for the same email address , each representing a separate product purchase , only one of those records is reflected in Zoho MA.

As a result, when a customer buys multiple products, and multiple records are created in Zoho CRM to track each purchase under the same email, only a single record is synced to MA. This behaviour makes it difficult to assign that synced record to multiple product-based segments in Zoho MA unless all relevant product purchase data is consolidated into that one synced record.

Let’s consider a scenario where you’ve created product-specific segments in Zoho MA such as “Pen Segment,” “Glue Segment,” “Pencil Segment,” etc , with specific criteria for each. When a record meets a segment’s conditions, it is automatically added and becomes eligible to receive targeted product campaigns.

While this setup works effectively when different product purchases are captured in separate synced records, it breaks down when only one record per email is synced. That’s because :

  • Segments in Zoho MA are driven by matching specific field-based criteria.

  • Only one record per unique email address is allowed via native Zoho CRM– Zoho MA sync.

Therefore, for a single synced record to be included in multiple segments, it must simultaneously meet the criteria for all relevant product segments. This requires that all product purchase data be consolidated into one Zoho MA record, using fields (e.g., product checkboxes) that Zoho MA can use for segmentation.

By structuring the Zoho CRM record this way, the contact can be added to multiple Zoho MA segments and receive campaigns related to each product they’ve purchased.



The Solution:

This solution enables adding a single record to multiple Zoho Marketing Automation (MA) segments by following these steps :

    1. Creating two custom modules in Zoho CRM :

      • Main Module (Purchase) : Stores one record per customer. This is the module that will be synced with Zoho MA to update values and sync record from Zoho CRM.

      • Duplicate Module (Purchase_Log) : Stores one record for each individual product purchase.

    2. Creating identical checkbox fields (one for each product) in both modules to track purchases at the product level as well as in Zoho MA to capture the values synced from Zoho CRM.

    3. Triggering a workflow with a custom function whenever a new product purchase is logged manually in the Purchase_Log module.

    4. Using the custom function to update or create the corresponding customer record in the Main Module, selecting the appropriate product checkboxes based on the logged purchase.

    5. Setting up synchronisation from the Main Module (Purchase) to Zoho MA :

      • Records from the Main Module (Purchase) are synced to Zoho Marketing Automation (MA) using the native integration between Zoho CRM and MA. As part of this sync setup :

        • Custom fields are created in Zoho MA to correspond with checkbox fields in Zoho CRM.

        • For example, if there is a checkbox field named "Glue" in Zoho CRM, a corresponding custom field such as "Glue_Selected" is also created in Zoho MA.

        • During the integration of Zoho CRM and Zoho MA, the "Glue" field in Zoho CRM is mapped to "Glue_Selected" field in Zoho MA.

        • When the checkbox is selected (i.e., set to True) in the Zoho CRM record, this value is carried over and updated in the Zoho MA record as well via the sync.

        • As a result, the "Glue_Selected" field in Zoho MA will also reflect True for that record.

    6. Creating product-specific segments in Zoho MA :

      • Segments in Zoho MA are then created based on these custom checkbox field values.

        • For example, the "Glue Segment" is created with the criteria :

          If Glue_Selected = True

        • Any synced record that meets this condition will be automatically added to the Glue Segment.

        • This allows you to build and send targeted product-specific campaigns to contacts based on their actual purchase history.



How It Works:

Let’s say your business sells 5 products : Pen, Pencil, Rubber, Scale, and Glue.

Step-by-Step Example :

Step 1 : Bill buys Glue (first-time customer)

  • A record is manually created in the Duplicate Module (Purchase_Log) with only the "Glue" checkbox selected.

    Note : Each product has a corresponding checkbox field in both the Purchase_Log and Purchase modules. When a new record is created for a purchase, the relevant product checkbox is selected by the user during creation of the record.

  • Upon creation of this record in the Purchase_Log module, a workflow is triggered, executing a custom function.

  • The custom function checks whether a record already exists for the name Bill in the Main Module (Purchase) :

    • If no existing record is found for Bill, a new record is created in the Main Module with "Glue" checkbox = selected.

  • Since the Main Module is synced with Zoho MA, this newly created record is synced to MA.

    • The data from the Zoho CRM record’s checkbox field is mapped to a corresponding custom field in Zoho Marketing Automation (e.g., "Glue_Selected"). The native sync automatically updates the value of this custom field in MA to reflect the selection in the Zoho CRM record.

    • Assuming a "Glue Segment" exists in Zoho MA with criteria based on the custom field (e.g., "Glue_Selected" is set to TRUE), Bill’s record will be added to the Glue Segment, as the condition is met. This is because the custom field in MA is updated via the native sync to match the selected checkbox value from the corresponding Zoho CRM record.
Step 2 : Bill buys Pen (returning customer)
  1. A new record is again manually created in the Purchase_Log module, this time with the "Pen" checkbox selected.

  2. The same workflow is triggered, running the custom function again.

  3. The function checks for an existing record in the Main Module for Bill :

  4. This time, Bill’s record is found, so the function simply updates the existing record to also select "Pen" check box = true.

  5. As the Main Module is already synced with MA, the record updates new checkbox value as well in the MA record. Now, the MA record for Bill has both : 
             
      "Glue" = true
       "Pen" = true

  6. Assuming a "Pen Segment" exists in Zoho MA as well with criteria based on the custom field (e.g., "Pen_Selected" is set to TRUE), Bill’s record will be added to the Glue Segment, as the condition is met. This is because the custom field in Zoho MA is updated via the native sync to match the selected checkbox value from the corresponding Zoho CRM record.



Outcome :

Bill's single record in Zoho MA now qualifies for both the Glue and Pen segment criteria, allowing it to be included in two separate Zoho MA segments. As a result, he will receive campaigns related to both products he has purchased.


Info

Prerequisites 

To set up this workaround successfully, please ensure the following prerequisites are available for the user implementing the setup :

Zoho CRM : 

  • Profile permissions in Zoho CRM to create custom modules and fields.

  • Profile Permissions to create/edit records and set up workflows in Zoho CRM.

Zoho Marketing Automation :

  • Admin access to create syncs , segments and field mapping.



Setup Instructions
: 

Step 1 : Zoho CRM Setup

  1. Create Two Custom Modules by navigating to Zoho CRM → Setup → Customisation → Modules and Fields → Create new module

    • Main Module (Purchase) : To store one consolidated record per customer, which is synced with Zoho MA.

    • Duplicate Module (Purchase_Log) : To store one unique record per product purchase.

  2. Add individual checkbox fields for each product in both the custom module's layout (e.g., Pen, Pencil, Glue, Rubber, Scale) by navigating to Zoho CRM → Setup → Customisation → Modules and Fields → Choose the created custom module → Choose the respective layout → Drag and drop the checkbox field from the field palette on the left for each of the products sold into the layout → Name each checkbox based on the product name.

Step 2 : Workflow and Custom Function Setup

  1. Kindly navigate to :

    Zoho CRM →
    Setup → Automation → Workflow Rules → Create Rule → Select the duplicate module created (Purchase_Log) → Choose "On Create" as the execution trigger → Specify conditions if any → Under Instant Actions, select Function → + New Function → Write Your Own → Enter the Function Name and Display Name → Click Create → Copy and paste the below attached code 


Info

void automation.Marketingautomation(Int Id,String name)

{

purchaseA = zoho.crm.getRecordById("Purchase_A",Id);  

email = purchaseA.get("Email");

pen = purchaseA.get("Pen");

pencil = purchaseA.get("Pencil");

glue = purchaseA.get("Glue");

rubber = purchaseA.get("Rubber");

scale = purchaseA.get("Scale");

purchase = zoho.crm.searchRecords("Purchase","Name:equals:" + name);

if(purchase.size() > 0)

{


for each  rec in purchase


{


mp = Map();


if(rec.get("Pen") == False)


{


mp.put("Pen",pen);


}


if(rec.get("Pencil") == False)


{


mp.put("Pencil",pencil);


}


if(rec.get("Glue") == False)


{


mp.put("Glue",glue);


}


if(rec.get("Rubber") == False)


{


mp.put("Rubber",rubber);


}


if(rec.get("Scale") == False)


{


mp.put("Scale",scale);


}


info "mp::: " + mp;


upd = zoho.crm.updateRecord("Purchase",rec.get("id"),mp);


info upd;


}

}

else

{


mp = Map();


mp.put("Pen",pen);


mp.put("Pencil",pencil);


mp.put("Glue",glue);


mp.put("Rubber",rubber);


mp.put("Scale",scale);


mp.put("Name",name);


mp.put("Email",email);


info "mp : " + mp;


crt = zoho.crm.createRecord("Purchase",mp);


info "crt : " + crt;

}

}


  1. Replace the respective module and field API names accordingly in the code : 

    a) In line 1 , replace "Purchase_A" with the custom Duplicate Module API Name created in Zoho CRM.

    b) In line 4 to 9 , replace ,
    "Email", "Pen", "Pencil" , "Glue" , "Rubber" , "Scale" with the Email field API Name of the Duplicate Module , Check Box fields API Names , created for your products with in the Duplicate Module.

    c) In line 10 , replace "Purchase" with the API Name of the Main Module that will be synced with Zoho MA. 

    d) In the lines , 16 , 18 , 20 , 22 , 24 , 26 , 28 , 30 , 32 , 34 replace with the custom product check box field API Names present in the Main Module.

    e) In the line 37 , update
    "Purchase" with the Main Module API Name. 

    f) In lines 44 - 49 , replace ,
    "Pen", "Pencil" , "Glue" , "Rubber" , "Scale", "Name" , "Email" with the check box field API name , Name field API name , Email field API name , present with in the Main Module.

    g) In line 52 , replace
    "Purchase" with the API Name of the Main Module.

  2. Click on edit arguments ->

    a) Click on + option, type # symbol in the right side input box, choose the
    Duplicate Module name and choose the Duplicate Module Id and name it as “Id” in the left side input box

    b) Click on + option, type # symbol in the right side input box, choose the Duplicate Module and choose Duplicate Module Name field and name it as
    “name” in the left side input box

    c) Click on save -> Save the workflow rule

Step 3 : Set Up Segments and Field Mapping in Zoho Marketing Automation :

  1. From Zoho Marketing Automation, navigate to Setup → Apps → Zoho CRM → New Sync. In the Sync Setup, under Zoho CRM Module to Sync, select Custom Module, choose the Main Module, and click Next.
    AlertIf you are setting up the sync between Zoho CRM and Zoho Marketing Automation for the first time, follow the steps below :

    Setup → Apps → Connect App → Choose Zoho CRM → Click on Connect → Select your Zoho CRM organisation (in which the above modules are created) → Click Integrate. In the Sync Setup, under Zoho CRM Module to Sync, select Custom Module, choose the Main Module, and click Next.

  2. Once the Map Fields section opens, under Zoho CRM Fields, select the checkbox fields from the Main Module. Then, under Zoho Marketing Automation Fields, click the dropdown and select the option to add new fields in Zoho MA.

  3. Create a Zoho MA field with relevant names for each checkbox field (e.g., "Glue_Selected" as mentioned in the above examples), and map it to the corresponding checkbox field from Zoho CRM’s Main Module.

  4. Repeat this process for all checkbox fields in the Main Module by creating appropriately named fields in Zoho MA and mapping them accordingly. This will ensure that the values of checkbox fields from Zoho CRM are properly mapped and synced into the corresponding fields in Zoho MA.

Segment Creation in Zoho Marketing Automation :

  1. Create individual segments for each product by navigating to the segments option under the contact section .

  2. Define the segment criteria based on the new fields created during the field mapped from Zoho CRM main module (e.g., you would have mapped the product check box ( eg "Glue" ) , value from the main module to a new field created during the field mapping in Zoho MA ( eg "Glue_Selected" ) with the criteria as "Is true"


Final Result

  • Summary :

    By consolidating product purchases using checkbox fields within a single Zoho CRM record, and syncing that record with Zoho Marketing Automation, businesses can bypass the limitation of one record per email and still include a customer in multiple product-specific segments. This enables precise targeting for campaigns based on complete purchase history, even when multiple purchases are made over time.




IdeaThere is also a screen recording of the demo showing the setup in action, attached below for your reference.

Screen Recording : 

https://workdrive.zohopublic.in/external/22b22abdb81ffb91e1b97cb24668f7f43664a43356c2500013f5416a24f2f46c



Quote
Custom Solution Created by  Hiruthik | Zoho Partner Support.

If you need any further clarifications, please don’t hesitate to contact  partner-support@zohocorp.com

Notes
Additionally, we kindly ask all "Europe and UK" partners to reach out to partner-support@eu.zohocorp.com


        Create. Review. Publish.

        Write, edit, collaborate on, and publish documents to different content management platforms.

        Get Started Now


          Access your files securely from anywhere

            Zoho CRM Training Programs

            Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

            Zoho CRM Training
              Redefine the way you work
              with Zoho Workplace

                Zoho DataPrep Personalized Demo

                If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

                Zoho CRM Training

                  Create, share, and deliver

                  beautiful slides from anywhere.

                  Get Started Now


                    Zoho Sign now offers specialized one-on-one training for both administrators and developers.

                    BOOK A SESSION







                                Quick LinksWorkflow AutomationData Collection
                                Web FormsEnterpriseOnline Data Collection Tool
                                Embeddable FormsBankingBegin Data Collection
                                Interactive FormsWorkplaceData Collection App
                                CRM FormsCustomer ServiceAccessible Forms
                                Digital FormsMarketingForms for Small Business
                                HTML FormsEducationForms for Enterprise
                                Contact FormsE-commerceForms for any business
                                Lead Generation FormsHealthcareForms for Startups
                                Wordpress FormsCustomer onboardingForms for Small Business
                                No Code FormsConstructionRSVP tool for holidays
                                Free FormsTravelFeatures for Order Forms
                                Prefill FormsNon-Profit

                                Intake FormsLegal
                                Mobile App
                                Form DesignerHR
                                Mobile Forms
                                Card FormsFoodOffline Forms
                                Assign FormsPhotographyMobile Forms Features
                                Translate FormsReal EstateKiosk in Mobile Forms
                                Electronic Forms
                                Drag & drop form builder

                                Notification Emails for FormsAlternativesSecurity & Compliance
                                Holiday FormsGoogle Forms alternative GDPR
                                Form to PDFJotform alternativeHIPAA Forms
                                Email FormsFormstack alternativeEncrypted Forms

                                Wufoo alternativeSecure Forms

                                TypeformWCAG

                                  Zoho FSM Video Tutorials


                                        All-in-one knowledge management and training platform for your employees and customers.

                                                  Create. Review. Publish.

                                                  Write, edit, collaborate on, and publish documents to different content management platforms.

                                                  Get Started Now




                                                                    You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                                        Manage your brands on social media


                                                                          • Desk Community Learning Series


                                                                          • Digest


                                                                          • Functions


                                                                          • Meetups


                                                                          • Kbase


                                                                          • Resources


                                                                          • Glossary


                                                                          • Desk Marketplace


                                                                          • MVP Corner


                                                                          • Word of the Day


                                                                          • Ask the Experts


                                                                            Zoho Sheet Resources

                                                                             

                                                                                Zoho Forms Resources


                                                                                  Secure your business
                                                                                  communication with Zoho Mail


                                                                                  Mail on the move with
                                                                                  Zoho Mail mobile application

                                                                                    Stay on top of your schedule
                                                                                    at all times


                                                                                    Carry your calendar with you
                                                                                    Anytime, anywhere




                                                                                          Zoho Sign Resources

                                                                                            Sign, Paperless!

                                                                                            Sign and send business documents on the go!

                                                                                            Get Started Now




                                                                                                    Zoho TeamInbox Resources





                                                                                                              Zoho DataPrep Demo

                                                                                                              Get a personalized demo or POC

                                                                                                              REGISTER NOW


                                                                                                                Design. Discuss. Deliver.

                                                                                                                Create visually engaging stories with Zoho Show.

                                                                                                                Get Started Now








                                                                                                                                      Wherever you are is as good as
                                                                                                                                      your workplace

                                                                                                                                        Resources

                                                                                                                                        Videos

                                                                                                                                        Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                                        eBooks

                                                                                                                                        Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                                        Webinars

                                                                                                                                        Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                                        CRM Tips

                                                                                                                                        Make the most of Zoho CRM with these useful tips.



                                                                                                                                          Zoho Show Resources