Fetch Record from Zoho CRM using record ID
Table of Contents
Note:
- Each time the zoho.crm.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.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.
Description
Fetch a record from Zoho CRM module using the record ID.
Syntax
<variable> =zoho.crm.getRecordById(<module_name>, <record_ID>, <query_value>, <connection>);
where,
| Params | Data type | Description |
| <variable> | KEY-VALUE | specifies the response returned by Zoho CRM. It represents the values fetched from the specified record against the API names of the respective fields. |
| <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 fetch the ID of a record after creating , searching or fetching it. |
<query_value> (optional) | KEY-VALUE | holds all the other parameters specified in the Zoho CRM API. Note:
|
<connection> (optional) | TEXT | is the name of the connection. Note:
|
Note:
In integration tasks, the parameters must be in the defined order as given in the syntax, for the Deluge task to be executed. If you choose to use an optional parameter, ensure that all preceding parameters in the syntax are explicitly specified. If a preceding optional parameter is not required, a null value can be assigned instead, to maintain the defined syntax order.
For example, in the below syntax, options_map and connection are optional parameters:
<variable> = zoho.crm.v8.task (<module_name>, <record_details>, <options_map>, <connection>);
If you want to use the connection parameter, module_name, record_details and options_map must be specified in the
exact order as the syntax. You can assign an empty map to the options_map parameter if it is not required.
Example
The following script fetches the record with ID - 23033XXXXXXXXXXXXXX in the Zoho CRM module - Leads.
response = zoho.crm.getRecordById("Leads", 23033XXXXXXXXXXXXXX);
where,
response"Leads"Response Format
Success Response
The success response returned is of the following format:
{
"Owner":{
"name":"Ben",
"id":"23033XXXXXXXXXXXXXX"
},
"Company":"Zylker",
"Email":"bruce.wills@zylker.com",
"Description":null,
"Discount":null,
"$currency_symbol":"$",
"Total_Amount":null,
"Rating":null,
"Website":null,
"Twitter":null,
"Salutation":null,
"Last_Activity_Time":null,
"First_Name":null,
"Full_Name":"Wills",
"Lead_Status":null,
"Industry":null,
"Modified_By":{
"name":"Ben",
"id":"23033XXXXXXXXXXXXXX"
},
"Skype_ID":null,
"$converted":false,
"$process_flow":false,
"Phone":"+1 678 XXX XXXX",
"Street":null,
"Zip_Code":null,
"id":"23033XXXXXXXXXXXXXX",
"Email_Opt_Out":false,
"$approved":true,
"Designation":null,
"$approval":{
"delegate":false,
"approve":false,
"reject":false,
"resubmit":false
},
"Modified_Time":"2018-03-28T11:34:40+05:30",
"Created_Time":"2018-03-28T11:34:40+05:30",
"$converted_detail":{ },
"$followed":false,
"$editable":true,
"City":null,
"No_of_Employees":0,
"Mobile":null,
"Last_Name":"Wills",
"State":null,
"Total":0,
"Lead_Source":null,
"Country":"United States",
"Tag":[ ],
"Created_By":{
"name":"Ben",
"id":"23033XXXXXXXXXXXXXX"
},
"Fax":null,
"Annual_Revenue":0,
"Secondary_Email":null
}
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"
}