Add Records

Table of Contents

Overview

This JS API task adds one or more records to a published 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 (Publish) REST API V2.1. Learn more about understanding the response

Request Details

Syntax

ZOHO.CREATOR.PUBLISH.addRecords(<config>).then(function(response){
//callback block
});

Syntax Details

The syntax holds:

  • <config> (object) - The configuration required to add a record using a published form. This configuration includes the following parameters.
NameTypeDescription
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_namestringLink 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>
private_linkstringThe set of alphanumeric characters following the form link name in the permalink. It is the last path of the URL that is obtained after publishing the form. Retrieve private_link using the Creator form's permalink:
https://creatorapp.zohopublic.com/<account_name>/<app_name>/form-perma/<form_name>/<private_link>
payloadobject

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.

Possible Errors

Refer to this page for the complete list of error codes and messages.

Sample Input

Copiedvar config = {
  app_name: "zylker",
  form_name: "timesheet",
  private_link: "1223456789poiuyytrewq",
  payload: {
    "data": {
      "Name": {
        "first_name": "James",
        "last_name": "Kyle"
     }
   }
  }
};
ZOHO.CREATOR.PUBLISH.addRecords(config).then(function (response) {
  if (response.code == 3000) {
    console.log(response);
  }
});

Sample Response

Copiedresponse = {
	"code": 3000,
	"data": {
		"ID": "2000000245119"
	},
	"message": "success"
}