Fetch Record from Zoho CRM V8 using Record ID
Table of Contents
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,
| Parameter | Data type | Description |
| <variable> | KEY-VALUE | Holds the response returned by Zoho CRM on successful task execution or error details on failure. |
| <module_name> | TEXT | Specifies 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 |
<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:
|
| <connection> | TEXT | Represents the link name of the connection which is connected to your Zoho CRM account. Note:
|
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"Leads"2303XXXXXXXXXXquery_data"fields"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"
}