Script to Tag Lead if a Contact Already Exists in Zoho CRM

Script to Tag Lead if a Contact Already Exists in Zoho CRM

Here's a LEAD Module script to add a tag to the record if a duplicate record is present in the Contacts, based on the Lead email. 


leadinfo = zoho.crm.getRecordById("Leads",leadid);

//fullname = leadinfo.get("Full_Name");

email = leadinfo.get("Email");

resp = zoho.crm.searchRecords("Contacts","(Email:equals:" + email + ")");

info "resp:" + resp;

info "size:" + resp.size();

if(resp.size() > 0)

{

update = zoho.crm.updateRecord("Leads",leadid,{"Contact_Check":true});

info update;

tags_list = List();

tag1 = Map();

tag1.put("name","IsContact");

tags_list.add(tag1); 

ids = {leadid};

param = Map();

param.put("tags", tags_list);

param.put("ids",ids);

info "Param : "+param;

leadTagUpdate = invokeurl

[

url : "https://www.zohoapis.com/crm/v6/Leads/actions/add_tags"

type : POST

parameters: param + " "

connection: "crmcon"

];

info "Tag Update : " + leadTagUpdate;

}


Replace "crmcon" with the name of the connection. 

Please add the scope, Scopes :ZohoCRM.modules.all, to the connection.


Contact us at faststart@zohelpers.com if you desire further assistance.

    • Related Articles

    • Procedures for Importing Data into Zoho CRM

      Data can be gathered through various sources such as, purchasing a record database, collecting from trade shows and campaigns, and so on. Importing records from such external sources to Zoho CRM is one of the most important lead creation activities ...
    • Get Ready to Sell on the Go with Zoho Mobile

      A mobile CRM is not a downsized version of the desktop CRM. It’s a more specialized and dedicated platform aimed at higher productivity. In the mobile version, you concentrate on what matters most. In this ebook, find out about the useful features ...
    • Zoho CRM Data Migration: An Introduction

      The Data Migration wizard in Zoho CRM ensures that your data is migrated accurately and helps you reduce much of the manual work. It automatically maps import files to CRM modules and import file columns to Zoho CRM fields. In the case of modules ...
    • How to Integrate GoToConnect to Zoho CRM

      Connect and configure Zoho CRM with GoTo Connect Integrate GoTo Connect with Zoho CRM to share messages, call logs, voicemail transcriptions, and leads from GoTo Connect to Zoho CRM. Important: A Super Admin must purchase the integrations bundle from ...
    • Configure Zoho CRM for Gmail Add-on

      As emails are the primary mode of communication and most businesses use different mailing platforms, it is crucial to maintain and track every interaction in a common database. As it helps people in the customer facing roles to deliver most relevant ...