Create a row in Zoho Analytics
Table of Contents
Note:
- Each time the zoho.reports.createRow 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.reports.createRow 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 create a row in a table in Zoho Analytics.
This integration task is based on the Zoho Analytics API - Add Row.
Syntax
<variable> = zoho.reports.createRow(<database_name>, <table_name>, <data_map>, <connection>);
| Parameter | Data type | Description |
| <variable> | KEY-VALUE | is the variable that will hold the response returned by Zoho Analytics. |
| <database_name> | TEXT | is the name of the database in Zoho Analytics which contains the required table. |
| <table_name> | TEXT | is the name of the table in which the row will be created. |
| <data_map> | KEY-VALUE | Key-value pairs with keys as the column names, along with their corresponding values. Values must be compatible with the column data type. If not, the value will not be assigned. |
| <connection> | TEXT | specifies the name of the Zoho Analytics connection. Note:
|
Example: Create a row in Zoho Analytics
The following sample snippet creates a row in Zoho Analytics with the given details.
rowInfo = map();
rowInfo.put("Region", "India");
rowInfo.put("Product Category", "Business Process");
rowInfo.put("Product", "Creator");
rowInfo.put("Customer Name", "John");
rowInfo.put("Sales", 1000);
mapResponse = zoho.reports.createRow("Website", "Search Analytics", rowInfo, "analytics_connection" );
rowInfo.put("Region", "India");
rowInfo.put("Product Category", "Business Process");
rowInfo.put("Product", "Creator");
rowInfo.put("Customer Name", "John");
rowInfo.put("Sales", 1000);
mapResponse = zoho.reports.createRow("Website", "Search Analytics", rowInfo, "analytics_connection" );
where,
| Param | Explanation |
| rowinfo | is a map variable that holds key-value pairs. |
| "Region" "Product Category" "Product" "Customer Name" "Sales" | are the column names in the table. |
| India Business Process Creator John 1000 | are column values. |
| mapResponse | varibale that holds the returned response. |
| "Website" | is the Database name in Zoho Analytics |
| "Search Analytics" | is the table name in Zoho Analytics |
| "analytics_connection" | is the connection link name |
Sample Response
The following is a sample success response:
{
"Region":"India",
"Product Category":"Business Process",
"Product":"Creator",
"Customer Name":"John"
"Sales":"1000"
}
"Region":"India",
"Product Category":"Business Process",
"Product":"Creator",
"Customer Name":"John"
"Sales":"1000"
}
Related Links
- Zoho Analytics API
- Common error codes can be viewed here