Bulk Create Records in Zoho CRM V8
Note:
- Each time the zoho.crm.v8.bulkCreate 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.bulkCreate 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.bulkCreate task allows you to create multiple records simultaneously under the specified module. The syntax employed for bulk records creation is almost similar to the zoho.crm.v8.create task just that the input format of the request (data map) would contain data for multiple records. This task is based on Zoho CRM Insert Records API.
Note: Using this task, you can create up to 100 records at a time.
Use Case Scenario
Let's say that a user would like to create multiple Zoho CRM records (say leads) simultaneously. This can be achieved by the
providing the record data inside a list through the zoho.crm.v8.bulkcreate task. More details on how to execute this task are
explained below.
Syntax
<variable> = zoho.crm.v8.bulkCreate(<module_name>, <records_value>, <options_map>, <connection>);
where,
| Parameter | Data type | Description |
| <variable> | KEY-VALUE | Holds the response returned by Zoho CRM on successful task execution or error details on failure. Here it holds the status of the task, the ID of the created record along with the values of the fields. |
| <module_name> | TEXT | Specifies the API name of the CRM module, where the records will be added. |
| <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. Note: Each module in Zoho CRM contains mandatory fields that are required to create a record. Refer to this page for the list of mandatory fields in each module. |
<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 |
| <connection> | TEXT | Represents the link name of the connection which is connected to your Zoho CRM account. Note:
|
Example : Creating Leads in bulk
Let's take a look below at an example of creating two leads using the lead name, company and email details in Zoho CRM from outside it.
createList = Collection(); recordMap1 = Collection("Company":"Zylker", "Last_Name":"Daly", "First_Name":"Paul", "Email":"p.daly@zylker.com"); recordMap2 = Collection("Company":"Tycoon", "Last_Name":"Richard", "First_Name":"Brian", "Email":"brian@villa.com"); createList.insert(recordMap1); createList.insert(recordMap2); leadInfo = zoho.crm.v8.bulkCreate("Leads",createList);
where,
leadInforecordMap1 recordMap2
createList"Company" "Last_Name" "First_Name" "Email"
"Leads"Note: The following modules follow a similar process of creating records, as explained in the above example:
- Leads
- Potentials
- Products
- Accounts
- Contacts
- Campaigns
- Vendors
- Cases
Response Format
Success Response
Following is a successful response when records are created in bulk in Zoho CRM:
{
"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 added",
"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 added",
"status": "success"
}
Failure Response
Below is the response returned when a record insertion is attempted without a required field. To know more about error codes, click here.
{
"code": "MANDATORY_NOT_FOUND",
"details": {
"api_name": "Last_Name"
},
"message": "required field not found",
"status": "error"
}