Get Related Records from Zoho CRM V8
Note:
- Each time the zoho.crm.v8.getRelatedRecords 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.getRelatedRecords 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 records from a submodule(related list) related with a specific record in a parent module in Zoho CRM. For instance, Notes attached to a particular Lead or Contacts linked to a particular account can be fetched using the ID of
the parent module record.
Syntax
<response> = zoho.crm.v8.getRelatedRecords(<relation_name>, <parent_module_name>, <record_id>, <page>, <per_page>, <query_value>, <connection>);
where,
| Parameter | Data type | Description |
| <response> | KEY-VALUE | Holds the response returned by Zoho CRM on successful task execution or error details on task failure. |
| <relation_name> | TEXT | Specifies the API name of the submodule or the related list. |
| <parent_module_name> | TEXT | Specifies the API name of the module to which the submodule belongs. For example, the “Notes” submodule belongs to the “Leads” parent module. |
| <record_id> | NUMBER | Specifies the ID of the parent module record. Learn how to retrieve the unique record ID from the response returned by Zoho CRM after creating, searching, or fetching a record. |
<page> (optional) | NUMBER | Indicates the page index from where the records must be fetched. Default value: 1 |
<per_page> (optional) | NUMBER | Specifies the number of records that need to be fetched per page. Default value: 200 Note: The <page> parameter must be specified in order to use this parameter. |
| <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. The <page> and <per_page> params must be specified to be able to specify this param. |
| <connection> | TEXT | Represents the link name of the connection which is connected to your Zoho CRM account. Note:
|
Example: Fetch Notes from Leads module
The following script fetches specified field records from Contacts module associated to the Account with ID - 4770XXXXXXXXXXX in Zoho CRM.
query_data = Collection(); query_data.insert("fields":"First_Name,id,Email,Last_Name"); response = zoho.crm.v8.getRelatedRecords("Contacts","Accounts",4770XXXXXXXXXXX,1,2,query_data,"crm");
where,
response"Contacts""Accounts"4770XXXXXXXXXXquery_data"fields"Response Format
The following is a sample response returned when related records are fetched:
"First_Name": "Harry",
"Email": "harrybales@zylker.com",
"Last_Name": "Bales",
"id": "23033XXXXXXXXXXXXXX"
}
Note: Refer to Zoho CRM API document - Related Records Data for possible error responses.