Creator Help

Attach files to Zoho CRM

Attach Files to CRM

You can attach a file from Zoho Creator to a module in Zoho CRM using the zoho.crm.attachFile()

Syntax

<CRM Response> = zoho.crm.attachFile(<Module Name>,<RecordID>,<file upload field>);

Where,
<Module Name> is the name of the CRM module
<RecordID> is the ID of the record in CRM to which the file will be attached.
<file upload field> refers to the Zoho Creator file to be uploaded
<CRM Response> is the map variable returned by CRM as response.

Example

fetch = Form_A [ID == 1913000000414279];
crmResp = zoho.crm.attachFile("Leads",348000000083031,fetch.Upload_Document);

Where,
fetch is the collection variable that stores the record from Form_A with the specified Record ID
Leads is the name of the CRM module
Upload_Document is the field name of the File Upload field in Zoho Creator.
fetch.Upload_document refers to this field in the collection variable "fetch"
crmResp is tha map variable returned by CRM as response.

Response from CRM

{"message":"File has been attached successfully","Id":"348000000085011"}

Note:

  • All the keys in the response map are case sensitive.

Attach Multiple Files to CRM

You can also attach a file from Zoho Creator to a module in Zoho CRM

Example

fetch = Add_Case [ID == xxxxxxxx];
leadinfo = { "Company" : "Test", "First Name" : "Test", "Last Name" : "test", "Email" : "test@zoho.com", "Phone" : "1234567",
"Address" : "test", "City" : "test", "State/Province" : "test", "Country" : "test", "Birth Date" : zoho.currentdate.subYear(20),
"Attachment" : fetch.File_upload };
crmResp = zoho.crm.create("Leads", leadinfo);
fetch = Form_A [ID == 1913000000414279];
attachResp = zoho.crm.attachFile("Leads",crmResp.get("Id"),fetch.Upload_Document);
fetch = Form_A [ID == 1913000000414345];
attachResp = zoho.crm.attachFile("Leads",crmResp.get("Id"),fetch.Upload_Document);

Top