Zoho Forms SUBFORM to Zoho CRM related list

Zoho Forms SUBFORM to Zoho CRM related list

Hi,

In my Zoho Forms, I ask the client if he has partners through a subform. The subform is linked to a hidden Zoho CRM subform, which then triggers a workflow to create contacts and link them to the contact Roles related list.

It works great, but there are two limitations:
1- Only allowed 10 fields inside Zoho CRM subform (vs 25 for Zoho Forms)
2- It uses my subform limit of 2, which I could use for something else.

So, I want to find another way to capture the information inside the Zoho Forms subform and create the contacts and link them to the related list.

I was thinking : Webhook or Zoho Flow, using custom functions inside zoho flow.

Here is my code inside Zoho CRM:


resp = invokeurl
[
type :GET
connection:"customfunction"
];
rolelist = resp.get("contact_roles").toJSONList();
dealDetails = zoho.crm.getRecordById("Deals",dealId.toLong());
//info dealDetails;
subform = ifnull(dealDetails.get("Partner"),"");
contIdlist = List();
for each ele in subform
{
mp = Map();
mp.put("First_Name",ifnull(ele.get("First_Name"),""));
mp.put("Last_Name",ifnull(ele.get("Last_name"),""));
mp.put("Role",ifnull(ele.get("Role"),""));
mp.put("Email",ifnull(ele.get("Email"),""));
relatedrecords = zoho.crm.searchRecords("Contacts","(Email:equals:" + ifnull(ele.get("Email"),"") + ")");
if(relatedrecords.size() > 0)
{
contid = relatedrecords.get(0).get("id");
}
else
{
create = zoho.crm.createRecord("Contacts",mp);
info "contcreate : " + create;
contid = create.get("id");
}
for each rec in rolelist
{
if(rec.get("name") = ifnull(ele.get("Role"),""))
{
roleid = rec.get("id");
info roleid;
}
}
mp = Map();
mp.put("CONTACTID",contid.toLong());
mp.put("Contact_Role",roleid);
update = zoho.crm.updateRelatedRecord("Contact_Roles",contid.toLong(),"Deals",dealId.toLong(),mp);
info mp;
info update;
}


Is there a way to trigger that function using a zoho forms webhook?

Thank you!