Fetch Record from Zoho CRM V8 using Record ID

Note:

  • Each time the zoho.crm.v8.getRecordById 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.getRecordById 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

This task is used to fetch a record from Zoho CRM module using the record ID.

Syntax

<variable> = zoho.crm.v8.getRecordById(<module_name>, <record_ID>, <query_value>, <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 Zoho CRM module from where the record needs to be fetched.
<record_Id>NUMBER

Specifies the ID of the record that needs to be fetched.

Learn how to retrieve the unique record ID from the response returned by Zoho CRM 
after creating, searching, or fetching a record.

<query_value>

 

KEY-VALUE

Holds all the other parameters specified in the Zoho CRM API. Only the <field> key and its corresponding value are mandatory in this collection. All other keys are optional.

Note:

  • The keys and values of this param should be provided according to the Zoho CRM API.
<connection>TEXT

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

Note:

  • The connection parameter is mandatory for Zoho Cliq and optional for all other Zoho products with CRM integration tasks.
  • The <query_value> params must be specified to be able to specify this parameter.
  • You can also connect to the Zoho CRM Sandbox while authorizing a connection.
  • Add relevant scopes as mentioned in Zoho CRM Get Records API document while creating the connection.
  • Refer to the list of Zoho services that support connections.

Example : Fetch records from Leads module with record ID

The following script fetches specified field records with ID - 23033XXXXXXXXXX in the Zoho CRM module - Leads.

query_data = Collection();
query_data.insert("fields":"First_Name,Last_Name,Company,Email");
response = zoho.crm.v8.getRecordById("Leads", 2303XXXXXXXXXX,query_data);
info response;
return response;

where,

response
is the variable which holds the data returned by Zoho CRM. It represents the values fetched from the specified record from Leads module.
"Leads"
is the TEXT that represents the API name of the Zoho CRM module from which the record needs to be fetched.
2303XXXXXXXXXX
is the NUMBER that represents the ID of the record to be fetched.
query_data
is the KEY-VALUE variable that holds the query parameters.
"fields"
is the mandatory system parameter key required to specify the fields that must be fetched and 
included in the response.

Response Format

Success Response

  • The success response returned is of the following format:

    {
       "First_Name": "Harry",
       "Last_Name": "Bales",
       "Company": "Zylker",
       "Email": "harrybales@zylker.com",
    }

Failure Response

  • The failure response for incorrect or non-existent record ID will be returned in the following format:

    {  "status": "failure"  }
  • The failure response for incorrect or non-existent module name will be returned in the following format:

    {
       "code": "INVALID_MODULE",
       "details": {
       },
       "message": "the module name given seems to be invalid",
       "status": "error"
    }