Get Record Count

Table of Contents

Overview

This JS API task fetches the count of records displayed by a report.

Request Details

Syntax

ZOHO.CREATOR.DATA.getRecordCount(config).then(function (response) {
   //your code goes here.
});

Syntax Details

The syntax holds:

  • <config> (object) - The configuration required to get the record count from a report. This configuration includes the following parameters.
NameTypeDescription
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_namestringLink name of the report from which the record count has 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)
stringCondition to filter the record, which is applied along with the condition specified in the report filter. The criteria must follow the format specified for the search criteria in REST API V2.1.

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",
criteria: "(Single_Line = \"High\")"
}; 
ZOHO.CREATOR.API.getRecordCount(config).then(function (response) {
console.log(reponse.result.records_count);
});

Sample Response

Copiedresponse = {
"code": 3000,
"result": { "records_count": "4" }
}