Add Records
Table of Contents
Overview
This JS API task adds one or more records to a form in your Zoho Creator application. Subject to data validations, each JSON object in the payload will be added as a record. A maximum of 200 records can be created per request.
This V2 task is based on the Add Records REST API V2.1. Learn more about understanding the response
Request Details
Syntax
ZOHO.CREATOR.DATA.addRecords(<config>).then(function(response){
//callback block
});
Syntax Details
The syntax holds:
- <config> (object) - The configuration required to add a record. This configuration includes the following parameters.
Name | Type | Description |
app_name (Optional) | string | Link name of the application to which data needs to be pushed. Retrieve the link name using the Creator form's URL: https://creatorapp.zoho.com/<account_name>/<app_name>/#Form:<form_name> Note: This parameter has to be passed only when you need to push data into other applications of the same Creator account. When not specified, data will be pushed to current application. |
form_name | string | Link name of the form to which the records need to be added. Retrieve the link name using the Creator form's URL: https://creatorapp.zoho.com/<account_name>/<app_name>/#Form:<form_name> |
payload | object | Form data supplied in JSON format, to include records in the form. The field link names necessary for the key-value pairs can be obtained from the field properties in form builder. Refer to the Setting Field Values section to learn more about the format. |
Payload Parameter
skip_workflow (Optional)
list
Prevents the associated workflows from being executed on the creation of a record.
Possible values: form_workflow, schedules, allNote: By default:
- When more than one type of workflow is mentioned, supply them as comma-separated values in a list. For example,
"skip_workflow" : ["schedules","form_workflow"] - If this parameter is not supplied, all associated workflows will be triggered.
- Blueprints and approvals will be triggered on the creation of records and cannot be skipped.
- When more than one type of workflow is mentioned, supply them as comma-separated values in a list. For example,
Possible Errors
Refer to this page for the complete list of error codes and messages.
Sample input to add one record
Copiedvar config = {
app_name: "zylker",
form_name: "timesheet",
payload: {
"data": {
"Name": {
"first_name": "James",
"last_name": "Kyle"
}
}
}
};
ZOHO.CREATOR.DATA.addRecords(config).then(function (response) {
if (response.code == 3000) {
console.log(response);
}
});
Sample response upon adding one record
Copiedresponse = {
"code": 3000,
"data": {
"ID": "2000000245119"
},
"message": "success"
}