The zoho.crm.upsert task is used to update the values of a particular record using its ID(optional) in Zoho CRM.

Note: If the ID is being specified, it should be included in the map. If the ID is not provided, a new record is created with the specified values. Record IDs can be obtained from the response returned from Get Records task.


<response> = zoho.crm.upsert(<module>,<values>,<optional_data>);


ParamsDescriptionData type


specifies the response message returned by Zoho CRM. It represents the record's creation and modification details against the API names of the respective fields.



specifies the API name of the module in which the record needs to be created or updated.

Note: Refer this for the instructions to get API names of the CRM modules and fields.



specifies the values of the record that needs to be created or updated, in a map format with key as CRM field's API name and its required corresponding value. 

The record id, if being specified, must be specified here.




specifies additional values other than the input values.
Possible Key: trigger
Possible Values: workflow, approval, blueprint


Example 1

The following script creates a new record in the module - Leads.

 record_values = Map();
 record_values.put("Company","Will Tech");
 response = zoho.crm.upsert("Leads",record_values);


is the KEY-VALUE response returned by Zoho CRM, which represents the modified by, modified time, created by, and created time information of the updated record.
is the TEXT that represents the name of the module where the record needs to be updated
is the KEY-VALUE variable that holds the new values of the record

Example 2

The following script updates the record with ID - 2303XXXXXXXXXXXXXXX, in the module - Leads.

 record_values = Map();
 response = zoho.crm.upsert("Leads",record_values);


is the NUMBER that represents the ID of the record that needs to be updated.

Response Format

Success Response

  • The success response returned is of the following format


Failure Response

  • The failure response returned for incorrect or non-existent record ID is of the following format

     "message":"the related id given seems to be invalid",

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: