Over the past year or so I’ve become quite comfortable working some deeper things with my friends at work with respect to Zoho CRM and the things we want to pull off with Zoho Flow, CRM Functions, webhooks, etc.
We’ve also got homegrown back office processes, and tried Workato and Zapier (two platforms that are worth a look if you have budget and the need to justify – we ultimately only had 1 or 2 automations and pulled back from the platform).
Well in the latest tiny problem that took longer than it should – courtesy of Deluge (maybe?) was really simple.
The function my friend built took a Deal ID as input. There was a custom field on the deal he had to interrogate, and then update a picklist on the deal with that value.
Should be easy. But syntax gets in the way.
Ideally, you can make a map that has the API name of the object you want to update, and the value to set.
Something simple like this. In our example, you can see “Deals” in the update statement. We are defining the module, the id of the object to update, and the map we made.
mp = Map();
mp.put("<OBJECT_API_NAME>",<OBJECT_VALUE>);
resp = zoho.crm.updateRecord("<MODULE_NAME)>",id.toLong(),mp);
This was compiled (in Zoho’s web based Deluge editor), and ran. It claimed success – but it never updated the Deal in question.
Well, after some internetting and getting a hold of Zoho Support to find our likely small mistake, they came back with a more explicit call invokeurl and calling the v7 API. I kind of feel like this didn’t need to happen since I was in the CRM instance where I wanted to perform the update – but after trying their version and seeing it work, it was just a problem I didn’t want to spend more time on. I’ve updated other fields before without having to do this, but something with the picklist seemed to complicate it. ¯\_(ツ)_/¯
datalist = List();
datalist.add(mp);
datamp = Map();
datamp.put("data",datalist);
response = invokeurl
[
url :"https://www.zohoapis.com/crm/v7/Deals/" + id
type :PUT
parameters:datamp + ""
// Note the following connection needs to exist in Zoho CRM
connection:"<MY_CONNECTION_NAME>"
];
The TLDR – Zoho Deluge can do a lot, but sometimes its behavior can be opaque even if you thought you were on a great path.
I believe Zoho CRM Function can be written in other languages now, and there are definitely cases where more standard languages would be a big help – little things like being able to do a loop. Deluge doesn’t offer that because Zoho doesn’t want a runaway process with an infinite loop I guess.
Anyway – it works now, and I have another mental post-it in case I need to do this again someday.