Choose where you’d like to start

Create Record

Note: The Creator V1 integration tasks are deprecated and will work until Creator V1 APIs reach their end of life on February 3rd, 2021. Click here for Zoho Creator V2 integration tasks.

Overview

This task is used to create a record in Zoho Creator.

Syntax

<variable>= zoho.creator.v1.createRecord(<ownerName>, <appLinkName>, <formLinkName>, <dataMap>, <connectionlinkName>);

where,

ParamsData TypeDescription

<variable>

KEY-VALUE

Variable which will hold the returned response.

<ownerName>

TEXT

is the name of the owner of the app in which the record will be created.

Name of the app owner is present in the url while editing the app: creator.zoho.com/appbuilder/<appOwner>

App owner name can also be fetched using the system variable zoho.adminuser

<appLinkName>

TEXT

is the link name of the application in which the record will be created.

Link names of applications, forms, and fields in your account can be viewed here (listed in brackets).

Application Link name can also be fetched using the system variable zoho.appname

<formLinkName>

TEXT

is the link name of the form in which the record will be added.

Link names of applications, forms, and fields in your account can be viewed here (listed in brackets).

<dataMap>

KEY-VALUE

contains field link names and their corresponding values for record creation in Zoho Creator form

<connectionLinkName>

(optional)*

TEXT

is the name of the Zoho Creator connection.

*Note

  • The connectionLinkName is mandatory when executed in Zoho Cliq.
  • The connection should be authtoken based. To create authtoken based connection with Zoho services, choose the default service - Zoho under pick your service in connections page.

Example

Let us consider the below example of creating a record in Zoho Creator. Assume that we have a form with the two fields - Task_Name (Single Line Field Type) and Task_Description (Single Line Field Type). The arguments - Task_Management (Application Link Name), Create_Task (Form Link Name), tony (Owner Name) will be supplied to createRecord() in the following example.

dataMap = {"Task_Name":"Priority Task", "Task_Description":"I need help configuring my new toaster"};

response = zoho.creator.v1.createRecord("tony", "Task_Management", "Create_Task", dataMap);

where,

response
is the KEY-VALUE pair that holds the response of the task
tony
is the TEXT that represents the application owner's name
Task_Management
is the TEXT that represents the application's link name
Create_Task
is the TEXT that represents the form's link name
datamap
is the KEY-VALUE variable that represents the key value pairs required to create records

Sample Response

Success

Following is a successful response received after creating a record:

{"values":
{
"Task_Description":"I need help configuring my new toaster",
"ID":3605445000000075003,
"Task_Name":"Priority Task"
},
"status":"Success"
}
 


To get the ID of the newly created record, execute the following snippet:

info <response_variable>.get("values").get("ID");

Error

Following is an error when the user tries to insert a record with the mandatory field not filled:

{"values":
{
"Task_Description":"",
"Task_Name":"Task-100"
},
"status":"Failure, Enter a value for Task Description"
}

Following is an error when the user tries to insert a duplicate record:

{"values":
{
"Task_Description":"I need help installing my air conditioner",
"Task_Name":"Task-100"
},
"status":"Failure,
Duplicate values found for 'Task Description' "
}

Following is an error when the user tries to insert an text value for a field which accepts only numbers:

{"values":
{
"Task_Description":"Test",
"Task_ID":"Task-100"
},
"status":"Failure,
Enter a valid number for Task ID"
}

Related Links

  • To fetch the string value to which the specified key is mapped, use get()
  • To get values from fetched records, use getJSON()

Get Started Now

Execute