Attach Files in Zoho CRM

Overview

Zoho Creator and Zoho CRM have been integrated for efficient usability purposes. We have developed tasks in Zoho Creator to perform automatic actions in Zoho CRM, which would otherwise require manual execution. For example, you can upload file attachments in Zoho CRM by simply specifying the Module Name and the record id where the attachment has to be uploaded. All this can be done using a Zoho Creator Form without having to do it manually in Zoho CRM. This can be achieved using zoho.crm.attachFile() task in Zoho Creator.

Use Case Scenario

Let's say we need to attach a file in a Zoho CRM Lead. The Zoho Creator Form can contain the Zoho CRM Lead field used to select the Lead, along with the File Upload field used to select the required file. This can be achieved by using the attachFile() task. Further details on how to execute this task are explained below.

Syntax

<response> = zoho.crm.attachFile(<module_name>, <record_id>, <file_upload_field>);

where,

Params Description

<response>

is the response returned asMAPby Zoho CRM.

<module_name>

is the name of the CRM module, of STRING datatype, where the file will be attached. Following is the list of supported modules.

Leads

Potentials

Products

Contacts

Campaigns

Vendors

Accounts

Cases

Quotes

Sales Orders

Purchase Orders

Invoices

<record_id>

is the record id, of Number datatype, to which the file will be attached.

<file_upload_field>

is the Form field which contains the file to be attached.

Attach a document to a Zoho CRM Lead

Let's assume we have a Zoho Creator Form with the following fields:

  • Lead (Zoho CRM Leads field type)
  • File Upload (File Upload field type)

To attach the selected document(in File Upload field) to the specified Lead record, add the following script in the required form actions block:

response = zoho.crm.attachFile("Leads", input.Lead_ID, input.File_Upload);

where,
response is the response returned as map by Zoho CRM
"Leads" is the module name, of string datatype, where the file will be uploaded.
input.Lead_ID is the input value of Lead field in the Form, of number datatype, to which the file will be attached.
input.File_Upload is the input value of File Upload field which contains the file to be attached.

Response Format

The response returned is of the following format:

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

Limitation

CRM Tasks can be executed only in accounts which are under Flexible and Unlimited Plans. Accounts under Free Plan, kindly upgrade to use CRM tasks. For more details scroll down to Integration and Web Data on the pricing page.

Script Builder

You can also make use of Script builder to define the zoho.crm.attachFile() task. Navigate to your application’s Workflow and drag and drop the Call Function under Deluge Tasks > Miscellaneous. Select Integration tasks and fill out necessary information.

Related Links

Share this post : FacebookTwitter