Bulk Update Records in Zoho CRM V8

Note:

  • Each time the zoho.crm.v8.bulkUpdate integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
  • Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.crm.v8.bulkUpdate integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script. 

Overview

The zoho.crm.v8.bulkUpdate task updates multiple records in the specified module of Zoho CRM. This task is based on the Zoho CRM Update Records API.

Note: Using this task, you can update up to 100 records at a time.

Use Case Scenario

Let us assume that a user would like to update multiple Zoho CRM records (say Leads) simultaneously. This can be achieved through the zoho.crm.v8.bulkUpdate task. More details on how to execute this task are explained below.

Syntax

<variable> = zoho.crm.v8.bulkUpdate(<module_name>, <records_value>, <options_map>, <connection>);

where,

ParameterData typeDescription
<variable>KEY-VALUEHolds the response returned by Zoho CRM on successful task execution or error details on failure.
<module_name>TEXTSpecifies the API name of the CRM module, where the records will be updated.
<records_value>LIST

Represents the input collection (key–value pairs) where each key is a Zoho CRM field's API name mapped to the corresponding value to be inserted into that field.

For example: {"Last_Name": "Williams"} here, Last_Name represents the field API name (key), and "Williams" represents the value inserted into that field.

The ID of the record which need to be updated must be included here in each map 
value in the format: {"id" : <recordID>}

Learn how to fetch the ID of a record after creating it or fetching the record.

<options_map>

(optional)

KEY-VALUE

An optional parameter, used to allow selective CRM automations on successful record creation.

Applicable key is trigger, and applicable values are workflow, approval, blueprint, and orchestration.

When the <options_map> parameter is specified in the function call, the mentioned 
automations (values) will get executed.

When this parameter is excluded, approvals, blueprints, and orchestration automations will get executed by default. To restrict all the CRM automations from getting executed, set the value of the “trigger” key to an empty list.

<connection>TEXT

Represents the link name of the connection which is connected to your Zoho CRM account.

Note:

Example : Updating Leads in bulk

Let's take a look below at an example of updating two leads in Zoho CRM from outside it.

updateList  =  Collection();
recordMap1 = Collection("id":"3171565000000600001",  "Company":"Zylker",  "Last_Name":"Daly", "First_Name":"Paul", "Email":"p.daly@zylker.com");
recordMap2  = Collection("id":"3171565000000600002", "Company":"Tycoon", "Last_Name":"Richard", "First_Name":"Brian", "Email":"brian@villa.com");
updateList.insert(recordMap1);
updateList.insert(recordMap2);
leadInfo = zoho.crm.v8.bulkUpdate("Leads", updateList);

where,

leadInfo
is the variable that holds the response returned by Zoho CRM.
recordMap1
recordMap2
are KEY-VALUE pairs that contains the data for updating the lead records.
updateList
is a collection variable that contains the list of KEY-VALUE pairs.
"Company"
"Last_Name"
"First_Name"
"Email"
are  key parameters that represent the API names of Zoho CRM fields of Leads module.
"Leads"
is the TEXT that represents the name of the CRM module where the records will be updated.

Note: The following modules follow a similar process of updating records, as explained in the above example:

  • Leads
  • Potentials
  • Products
  • Accounts
  • Contacts
  • Campaigns
  • Vendors
  • Cases

Response Format

Success Response

  • The following is the success response returned by Zoho CRM upon execution of a bulk update task.

    {
       "code": "SUCCESS",
       "details": {
          "Modified_Time": "2018-07-11T18:06:04+02:00",
          "Modified_By": {
             "name": "Rodriguez",
             "id": "3171565000000152015"
          },
          "Created_Time": "2018-07-11T18:06:04+02:00",
          "id": "3171565000000600000",
          "Created_By": {
             "name": "Rodriguez",
             "id": "3171565000000152018"
          }
       },
       "message": "record updated",
       "status": "success"
    },
    {
       "code": "SUCCESS",
       "details": {
          "Modified_Time": "2018-07-11T18:06:04+2:00",
          "Modified_By": {
             "name": "Rodriguez",
             "id": "3171565000000152015"
          },
          "Created_Time": "2018-07-11T18:06:04+02:00",
          "id": "3171565000000600001",
          "Created_By": {
             "name": "Rodriguez",
             "id": "3171565000000152018"
          }
       },
       "message": "record updated",
       "status": "success"
      
    }

Failure Response

  • Below is the error response returned when we try to update a record without mapping the mandatory fields. To know more about error codes, click here.

    {
       "code": "MANDATORY_NOT_FOUND",
       "details": {
          "api_name": "Last_Name"
       },
       "message": "required field not found",
       "status": "error"
    }