Get Records
Table of Contents
Note:
Each time the Get Records 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.
The API limits deduction depend on where the request is sent and received.
When this task is executed to send request,within the same Zoho Creator account - Both the Developer API limit and the External calls limit are deducted from that Creator account.
from a different service to a Zoho Creator account - The Developer API limit is deducted from the target Creator account, and the external calls limit is deducted from the service that sends the request.
from one Zoho Creator account to another Zoho Creator account - The Developer API limit is deducted from the target Creator account, and the External calls limit is deducted from the Creator account that sends the request.
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 the Get Records task is placed inside a for each task that iterates five times, five external API calls will be consumed, even though the task appears only once in the script.
Overview
The zoho.creator.getRecords task is used to fetch records from the specified report of the Zoho Creator application.
Syntax
<variable> = zoho.creator.getRecords(<owner_name>, <app_link_name>, <report_link_name>, <criteria>, <from_index>, <limit>, <connection_link_name>);
where:
| Parameter | Data Type | Description |
|---|---|---|
| <variable> | KEY-VALUE | Variable that will hold the returned response. |
| <owner_name> | TEXT | Name of the owner of the app from which the records need to be fetched. Note: Name of the application owner can be fetched in the following ways:
|
| <app_link_name> | TEXT | Link name of the application from which the records need to be fetched. Note: Link name of the application can be fetched in the following ways:
|
| <report_link_name> | TEXT | Link name of the report from which the records need to be fetched. Note:
|
| <criteria> | TEXT | The condition based on which the records need to be fetched. Note:
|
| <from_index> | NUMBER | Starting index of the records (that meet the criteria) from where the records need to be retrieved. Start index: 1 |
| <limit> | NUMBER | Number of records need to be fetched Maximum limit: 200 records |
| <connection_link_name> | TEXT | Name of the Zoho Creator connection. Note:
|
Example 1: Fetch records from the specified report
The following example fetches records without a specified condition, start index, or record limit from Zoho Creator:
response = zoho.creator.getRecords("Shawn","Task_Management", "All_Tasks", "", 1, 200, "creator_oauth_connection");
where:
response"Shawn""Task_Management""All_Tasks""creator_oauth_connection"Example 2: Search using criteria
Assume that we have a form with the two fields - Task_Name (Single Line Field Type) and Task_Description (Single Line Field Type) in the application - Task_Management. The following example fetches the records that hold the value - ServiceTask against the Task_Name field from the report - All_Tasks.
response = zoho.creator.getRecords("John","Task_Management","All_Tasks","Task_Name == \"ServiceTask\"", 1, 200, "creator_oauth_connection");
where:
response"John""Task_Management""All_Tasks""Task_Name == \"ServiceTask\""Example 3: Fetch first 100 records
The following example fetches the first 100 records from the specified report of your Zoho Creator application:
response = zoho.creator.getRecords("Shawn","Task_Management","All_Tasks","",1,100, "creator_oauth_connection");
where:
response"Shawn""Task_Management""All_Tasks"""1100Example 4: Search using criteria with a lookup field
Assume that we have a form with a lookup field - Department (Lookup Field Type) which refers to the form - Department. The Department form contains a field - Name (single line field type). The following example fetches the records from the report - All_Employees if the looked up record holds the value - Electrical against the field - Name .
response = zoho.creator.getRecords("Tony","Employee_Management","All_Employees","Department.Name == \"Electrical\"", 1, 200, "creator_oauth_connection");
where:
response"Tony""Employee_Management""All_Employees""Department.Name == \"Electrical\""Response Format
Success Response
The successful response will be returned in the following format:
{
"code": 3000,
"data": [
{
"Task_Name": "Priority Task",
"Task_Description": "I need help installing my air conditioner",
"ID": "3605445000000075003"
},
{
"Task_Name": "Support Ticket1",
"Task_Description": "Toaster Configurations",
"ID": "3605445000000065010"
}
]
}
To get the IDs of the fetched records, execute the following snippet:
records = response.get("data"); for each var in records { info var.get("ID"); }
Failure Response
The failure response for incorrect or non-existent application name will be returned in the following format
{
"code": 2892,
"message": "No application named <application_name> found. Please check and try again."
}The failure response for incorrect owner name will be returned in the following format
{
"code": 1110,
"message": "No workspace named <owner_name> found. Please enter a valid workspace value."
}The failure response for incorrect or non-existent report name will be returned in the following format
{
"code": 2894,
"message": "No report named <report_link_name> found. Please check and try again.""
}