Create Record in Zoho Creator
Table of Contents
Overview
The zoho.creator.createRecord task adds one or more records to the specified Zoho Creator form with the given input field values.
Syntax
<variable> = zoho.creator.createRecord(<owner_name>, <app_link_name>, <form_link_name>, <input_values>, <other_params>, <connection>);
where:
Parameter | Data Type | Description |
<variable> | KEY-VALUE | Variable that will hold the details of the records created. |
<owner_name> | TEXT | Name of the owner of the app in which the records will be created. Note: Name of the application owner can be fetched in the following ways:
|
<app_link_name> | TEXT | Link name of the application in which the records will be created. Note: Link name of the application can be fetched in the following ways:
|
<form_link_name> | TEXT | Link name of the report in which the records will be created. Note:
|
<input_values> | KEY-VALUE/ LIST | To create a single record, supply input field values as a KEY-VALUE collection. The keys to this parameter are the field link names and the values are their corresponding input values. To create more than one record, supply the input data as a LIST of KEY-VALUE collections. Data stored in each KEY-VALUE element of the LIST will be created as a record. The keys of these elements must be the field link names and values must be their corresponding input values. Note:
|
<other_params> | KEY-VALUE | Other optional parameters specified in Zoho Creator Add Records API document. Note: To skip this parameter, provide an empty map as its value. |
<connection> | TEXT | Link name of the connection created and connected to your Zoho Creator account. Note:
|
Example 1: Create a single record
The following example creates a record in the form - Tasks of the Zoho Creator application - Task_Management:
// Create a KEY-VALUE variable to hold the input record values dataMap = Map(); dataMap.put("Task_Name", "Priority Task"); dataMap.put("Task_Description", "I need help configuring my new toaster"); // Create an empty KEY-VALUE variable to skip the other_params parameter otherParams = Map(); //Write create records integration task to add the input data into the specified form response = zoho.creator.createRecord("Shawn", "Task_Management", "Tasks", dataMap, otherParams, "creator_oauth_connection");
where:
response
"Shawn"
"Task_Management"
"Tasks"
dataMap
"Task_Name" "Task_Description"
"creator_oauth_connection"
Example 2: Create multiple records
The following example creates two records in the form - Tasks of the Zoho Creator application - Task_Management:
// Create a KEY-VALUE variable to hold the input values of first record record1 = Map(); record1.put("Task_Name", "Priority Task"); record1.put("Task_Description", "I need help configuring my new toaster"); // Create a KEY-VALUE variable to hold the input values of second record record2 = Map(); record2.put("Task_Name", "Support Ticket 1"); record2.put("Task_Description", "Toaster Configurations"); // Create a LIST variable to hold the details of the records that need to be created records_list = List(); records_list.add(record1); records_list.add(record2); // Create an empty KEY-VALUE variable to skip the other_params parameter otherParams = Map(); //Write create records integration task to add the input data into the specified form response = zoho.creator.createRecord("Shawn", "Task_Management", "Tasks", records_list, otherParams, "creator_oauth_connection");
where:
records_list
"Task_Name" "Task_Description"
Response Format
Success ResponseThe success response will be returned in the following format:
{
"code": 3000,
"data": {
"ID": "3893272000000191003"
},
"message": "Data Added Successfully"
}
The failure response for incorrect or non-existent application name will be returned in the following format
{
"code": 2892,
"message": "No application named <application_name> found. Please check and try again."
}The failure response for incorrect owner name will be returned in the following format
{
"code": 1110,
"message": "No workspace named <owner_name> found. Please enter a valid workspace value."
}The failure response for incorrect or non-existent report name will be returned in the following format
{
"code": 2894,
"message": "No report named <report_link_name> found. Please check and try again."
}
Related Links
- Zoho Creator - Add Records API document
- Zoho Creator API - Possible error messages and status codes
- To fetch the text value to which the specified key is mapped, use get()
- To get values from fetched records, use getJSON()
- To get the Application owner Name, Application link name, form link Name and/ or report link name, you can visit Creator API Link Names