Create Record in Zoho People
Table of Contents
Note:
- Each time the zoho.people.create integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.people.create integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
Overview
The zoho.people.create task is used to create a record in the specified Zoho People form.
Syntax
<response> = zoho.people.create(<form_name>, <record_values>, [<connection>]);
where:
| Params | Data type | Description |
| <response> | KEY-VALUE | The ID of the record that will be created and the status of the executed task. |
| <form_name> | TEXT | The label name of the form in which the record needs to be created. Note: Click here for the instructions to get the form label names in Zoho People. |
| <record_values> | KEY-VALUE | The values of the new record that needs to be created. The keys to this param are the label names of the fields in the specified form. Note: Click here for the instructions to get the field label names. |
<connection> (optional)* | TEXT | The name of the connection. *Note: This param is not applicable to Zoho Creator and mandatory in Zoho Cliq. |
Note:
In integration tasks, the parameters must be in the defined order as given in the syntax, for the Deluge task to be executed. If you choose to use an optional parameter, ensure that all preceding parameters in the syntax are explicitly specified. If a preceding optional parameter is not required, a null value can be assigned instead, to maintain the defined syntax order.
For example, in the below syntax, options_map and connection are optional parameters:
<variable> = zoho.crm.v8.task (<module_name>, <record_details>, <options_map>, <connection>);
If you want to use the connection parameter, module_name, record_details and options_map must be specified in the
exact order as the syntax. You can assign an empty map to the options_map parameter if it is not required.
Example
The following script creates a record in the Zoho People form - Employee:
//Create a KEY-VALUE variable to hold the values of the new record values_map = Map(); values_map.put("EmployeeID", "12311"); values_map.put("FirstName", "Richard"); values_map.put("LastName", "Patrick"); values_map.put("EmailID", "richard@zylker.com"); //Execute the Zoho People integration task to create a new record response = zoho.people.create("P_Employee", values_map);
where:
values_map"EmployeeID""FirstName""LastName""EmailID"
"P_Employee"Response Format
Success Response
The success response will be returned in the following format:
{
"result": {
"pkId": "105893000000216001",
"message": "Successfully Added"
}
}
To fetch the ID of the newly created record from the success response obtained, execute the following snippet:
info <response_variable>.get("result").get("pkId");
Failure Response
The failure response due to duplicate record values will be returned in the following format:
{
"response": {
"message": "Error occurred",
"uri": "/api/forms/json/employee/insertRecord",
"errors": {
"code": 7051,
"message": {
"EmployeeID": "Duplicate value present for EmployeeID "
}
},
"status": 1
}
}The failure response due to incorrect form name will be returned in the following format:
{
"response": {
"message": "Error occurred",
"uri": "/api/forms/json/test/insertRecord",
"errors": {
"code": 7011,
"message": "Form name 'Test' is invalid"
},
"status": 1
}
}