Get Records
Table of Contents
Overview
This JS API task fetches the records displayed in a report. Its response will contain the data from the quick view and detailed view of all the visible fields present in the records.
Request Details
Syntax
ZOHO.CREATOR.API.getAllRecords(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 |
appName (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/<accountName>/<appName>/#Report:<reportName> 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. |
reportName | 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/<accountName>/<appName>/#Report:<reportName> |
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. |
page (Optional) | int | Page index or the page number of a report, from which records need to be retrieved. Note: The default page value is 1. |
pageSize (Optional) | int | Total number of records that need to be retrieved from the specified page. Note: The default pageSize value is 100 and the maximum value that can be specified is 200. |
Possible Errors
Refer to this page for the complete list of error codes and messages.
Sample Input
Copiedvar config = {
appName : "zylker",
reportName : "All-Timesheet",
criteria : "(Status == \"Open\" && Priority = \"High\")",
page : 1,
pageSize : 10
}
ZOHO.CREATOR.API.getAllRecords(config).then(function(response){
var recordArr = response.data;
for(var index in recordArr){
console.log(recordArr[index]);
}
});
Sample Response
Copiedresponse = {
"code": 3000,
"data": [
{
"ID": "52129000000146011",
"Name": {
"first_name": "James",
"last_name": "Kyle",
"display_value": "James Kyle"
},
"Address": {
"address_line_1": "Dari Mart",
"address_line_2": "995 Hayden Bridge Rd",
"district_city": "Springfield",
"state_province": "Oregon",
"postal_code": "97477",
"country": "United States",
"latitude": "33.9307727",
"longitude": "-116.8767541",
"display_value": "Dari Mart, 995 Hayden Bridge Rd, Springfield, Oregon, United States"
},
"Rich_Text": "The phone number is <b>+1541-726-4051</b>",
"Phone_Number": "+15417264051",
"Single_Line": "A simple one line text",
"Email": " james@zylker.com ",
"Number": "23",
"Decimal": "1000.00",
"Percent": "60.00",
"Date_field": "10-Jan-2020",
"Date_Time": "23-Mar-2020 12:25:43 PM",
"Dropdown": "Open",
"Radio": "Closed",
"Multi_Select": [
"New",
"Used"
],
"Checkbox": [
"Refurbished",
"Used"
],
"File_Upload": "/api/v2/zylker/Contacts/view/Contacts/635900380/Upload/download",
"Ur1": {
"value": "Dari Mart",
"url": " www.darimart.com",
"title": "Dari mart provisional store"
},
"Lookup_Single_Select": {
"display_value": "James - 4269",
"ID": "521270000078464"
},
"Lookup_Multi_Select": [
{
"display_value": "Door Step Delivery",
"ID": "5212750000247932"
},
{
"display_value": "Cash on Delivery",
"ID": "5212750000564867"
}
],
"Subform": [
{
"display_value": "Service Equipment,New Order",
"ID": "5212750000433263"
},
{
"display_value": "Rotary Machine,Replacement",
"ID": "5212750000090778"
}
]
},
{
//Record 2
},
{
//Record 3
}
]
}
Show full
Show less