Creator Help

Create a Row in Zoho Reports

Create a row in Zoho Reports

You can use Zoho Creator Form to collect information and populate it in a Zoho Reports table as a new row using createRow() Deluge task.

Syntax

<return value as map> = zoho.reports.createRow(<DATABASE NAME>,<TABLE NAME>,<Field values as map>);

where,
<return value> is the map object containing response returned by Zoho Reports.
<Database Name> is the name of the database in Zoho Reports,  where the record should be added.
<Table Name> is the name of the table in Zoho Reports, where the record should be added.
<Field values> is the map variable that holds the key,value pairs. The map key is the column name of the table and the map value is the field value as submitted in the ZC form. For example, "Company" : input.Company_Name. Here, "Company" is the colum name of table mentioned as Table Name argument and input. Company_Name refers to the value specified in the Company_Name field in the Zoho Creator form.

Example

Sample script to create a new row in Zoho Reports. You can add the script to On Add -> On Success block of the form.

rowInfo = map();
rowInfo.put("Region", input.Region);
rowInfo.put("Product Category", input.Product_Category);
rowInfo.put("Product", input.Product);
rowInfo.put("Customer Name", input.Customer_Name);
rowInfo.put("Sales", input.Sales.toString());
rowInfo.put("Profit", input.Profit.toString());
rowInfo.put("Cost", input.Cost.toString());
mapResponse = zoho.reports.createRow(<DATABASE NAME>,<TABLE NAME>, rowInfo );

Code Explanation

rowInfo is the map variable that holds the key,value pairs.
mapResponse is the variable which holds the xml string returned by Zoho Reports.

Related Links

http://www.zoho.com/reports/help/api/adding-single-row.html

Top