Get Records
Table of Contents
Overview
This JS API task fetches all records displayed in a report. Its response will contain the data of all the visible fields present in the records. A maximum of 1000 records can be fetched per request.
This V2 task is based on the Get Records REST API V2.1.
Request Details
Syntax
ZOHO.CREATOR.DATA.getRecords(config).then(function(response){
//callback block
});
Syntax Details
The syntax holds:
- <config> (object) - The configuration required to get records from a report. This configuration includes the following parameters.
Name | Type | Description |
app_name (Optional) | string | Link name of the application from which data needs to be pulled. Retrieve the link name using the Creator report's URL: https://creatorapp.zoho.com/<account_name>/<app_name>/#Report:<report_name> Note: This parameter only needs to be passed when you need to pull data from other applications in the same Creator account. When not specified, data will be pulled from the current application. |
report_name | string | Link name of the report from which the records have to be fetched. Retrieve the link name using the Creator report's URL: https://creatorapp.zoho.com/<account_name>/<app_name>/#Report:<report_name> |
criteria (Optional) | string | The criteria using which you want the API request to filter the target report. If not specified, the request will fetch the first 200 records from the report (as per its predefined sorting order). Refer to the Defining the search criteria section to learn more. |
field_config (Optional) | string | Fetches fields of the records based on the input value.
Note: This API will not fetch the record displayed in the related data blocks of the detail view. |
fields (Optional) | string | If the value of field_config parameter is given as custom, this parameter should also be included. The required fields' link names need to be mentioned as individual comma-separated strings. Note:
|
max_records (Optional) | int | The number of maximum records that will be fetched upon one request. If the criteria parameter is mentioned, the maximum count will apply only for the records that match the criteria. |
record_cursor (Optional) | string | Every time records exist beyond the maximum fetch count (1000), a unique key will be received in the response. This can be added in the next API call's <config> parameter as a key-value pair to fetch the consecutive batch of 1000 records, if they exist. |
Possible Errors
Refer to this page for the complete list of error codes and messages.
Sample Input
Copiedvar config = {
app_name: "zylker",
report_name: "All-Timesheet"
};
ZOHO.CREATOR.DATA.getRecords(config).then(function (response) {
console.log(response);
});
Sample Response
Copiedresponse = {
"code": 3000,
"data": [{
"ID": "2000000193171",
"Name": {
"first_name": "Lily",
"last_name": "Kyle",
"display_value": "Lily Kyle"
}
},
{
"ID": "2000000193173",
"Name": {
"first_name": "Peter",
"last_name": "James",
"display_value": "Peter James"
}
}]
}