Create Record in Zoho People

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.

Note: You can also create records for custom forms in Zoho People.

Syntax

<response> = zoho.people.create(<form_name>, <record_values>, [<connection>]);

where:

ParamsData typeDescription
<response> KEY-VALUEThe 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.

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
The KEY-VALUE variable that holds the values of the record that needs to be created.
"EmployeeID"
"FirstName"
"LastName"
"EmailID"
The TEXT values that represent the field label names.
"P_Employee"
The TEXT that represents the form label name.

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
      }
      }

Related Links