From 9731f58523adb6ca67beef73a823ad2aeced0dba Mon Sep 17 00:00:00 2001 From: EmanueleBittencourt Date: Sat, 8 Jun 2024 15:39:04 -0300 Subject: [PATCH] Tag a record --- pages/crm/tagARecord | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 pages/crm/tagARecord diff --git a/pages/crm/tagARecord b/pages/crm/tagARecord new file mode 100644 index 0000000..b59d947 --- /dev/null +++ b/pages/crm/tagARecord @@ -0,0 +1,53 @@ +--- +title: Tag a record in Zoho CRM. Or remove a tag. +description: Explanation of how to insert or remove a Tag in a Zoho CRM record using a deluge script. +--- +# Tag a Record + +To insert or remove a tag using a Deluge script, you need to create a connection that allows you to perform this action via an API call. + +To create a connection, you can follow these steps: + +1. In Zoho CRM, go to Settings > Connections > Create a New Connection. +2. Select the service: Zoho OAuth. +3. Select the scope: ZohoCRM.modules.ALL. +4. Create the connection and activate it. +5. Copy the sample code provided. + +In this example, a script was created for an action in a workflow for the Leads module. + +```javascript +//mapping of arguments: leadId = Leads - ID Leads + +lead = zoho.crm.getRecordById("Leads",leadId); + +//How to remove a Tag +tag = "Cold"; +mp = Map(); +mp.put("tag_names",tag); +response = invokeurl +[ + url: "https://www.zohoapis.com/crm/v2/Contacts/" + leadId + "/actions/remove_tags?" + type: POST + parameters: mp + connection:"xxxxxxx" //connection name +]; + +info "Response delete tag : " + response; + +//How to insert a Tag +tag = "Hot"; +mp = Map(); +mp.put("tag_names",tag); +response = invokeurl +[ + url: "https://www.zohoapis.com/crm/v2/Contacts/" + leadId + "/actions/add_tags?" + type: POST + parameters: mp + connection: "xxxxxxx" //connection name +]; +info "Response delete tag : " + response; +``` + +Contributor: Emanuele Bittencourt +emanuelebittencourt3@gmail.com \ No newline at end of file