Hi all,
Just sharing a custom function that I created in case it's useful to others. I wanted a way for users to receive a Zoho Cliq notification whenever they are @mentioned in a CRM note, while keeping all communication inside CRM. Users are already notified via email but this provides a second notification layer that our team generally prefers. This setup uses a custom Deluge function and a Cliq bot to send notifications dynamically to the mentioned users.
What this does:
Step 1: Create a Cliq Bot
In Zoho Cliq:
Step 2: Create a Cliq Connection in CRM
In Zoho CRM:
Step 3: Create the Deluge Function
In CRM:
void automation.cliqMentionFromDealNote(String dealId)
{
dealUrlBase = "https://crm.zoho.com/crm/orgXXXXXXXXXXXX/tab/Deals/";
botName = "crmnotifier";
deal = zoho.crm.getRecordById("Deals",dealId);
dealName = ifnull(deal.get("Deal_Name"),"Deal");
dealUrl = dealUrlBase + dealId;
notes = zoho.crm.getRelatedRecords("Notes","Deals",dealId);
if(notes != null && notes.size() > 0)
{
note = notes.get(0);
noteContent = ifnull(note.get("Note_Content"),"");
createdBy = "Unknown";
if(note.get("Created_By") != null)
{
createdBy = ifnull(note.get("Created_By").get("name"),"Unknown");
}
nl = hextotext("0A");
parts = noteContent.toList("user#");
alreadySent = List();
for each part in parts
{
if(part.contains("#"))
{
idParts = part.toList("#");
if(idParts.size() > 1)
{
cliqPart = idParts.get(1);
cliqId = cliqPart.toList("]").get(0);
if(cliqId != null && cliqId != "" && !alreadySent.contains(cliqId))
{
msg = "*CRM Mention*" + nl + nl;
msg = msg + "From: " + createdBy + nl;
msg = msg + "Deal: " + dealName + nl;
msg = msg + dealUrl;
message_data = Map();
message_data.put("text",msg);
message_data.put("userids",cliqId);
response = zoho.cliq.postToBot(botName,message_data,"cliq_connection");
alreadySent.add(cliqId);
}
}
}
}
}
}
Replace orgXXXXXXXXXXXX with your actual CRM org ID.
Step 4: Create a Workflow Rule
In CRM:
How it works:
When someone writes a note and tags users, CRM stores the mention internally like:
crm[user#CRM_USER_ID#CLIQ_USER_ID]crm
The function parses this, extracts the Cliq user IDs, and sends each mentioned user a notification via the bot.
Example notification in Cliq:
CRM Mention
Notes: