Create record

Create record in Zoho Recruit

Overview

This task is used to create records in Zoho Recruit.

Syntax

<variable> = zoho.recruit.addRecord(<module_name>, <data_map>, <duplicate_check>, <connection>);

where,

ParameterData typeDescription

<response> 

KEY-VALUE

is the response returned by Zoho Recruit.

<module_name> 

TEXT

name of the module in which the record will be created.

Following are the applicable modules.

Candidates

Job Openings

Candidates

Contacts

Clients

Custom Module

<data_map>

KEY-VALUE

keys and values to create the record with the required data.

Refer this page for details about mandatory fields in each module.

<duplicate_check>NUMBER
Allowed values: 1 or 2.

If the value is specified as 1, it will throw an error if the same record already exists. 

If the value is specified as 2, it will search and update the record if it already exists. 

If this param is not specified, the record will be added as a new record.

<connection>

(optional)*

TEXT

specifies the name if the Zoho Recruit connection.

Note: This param is not supported in Zoho Creator, and is optional in all other Zoho services.

Create a record in Candidates module

The following script creates a record in the "Candidates" module in Zoho Recruit.

candidatesMap=map();candidatesMap.put("Last name","Richard");candidatesMap.put("Email","richard@zoho.com");candidatesMap.put("Mobile","+91 998877665");candidatesMap.put("Experience in years","5");candidatesMap.put("Current Job Title","Assistant Manager");candidatesMap.put("Skill Set","MCA");candidatesMap.put("Experience Details","Working in UTS for 5 years");response=zoho.recruit.addRecord("Candidates", candidatesMap);

where,

candidatesMap
is a map variable which will hold keys and values required to create the record. It is of MAP data type.
"Last name""Email""Mobile""Experience in years""Current Job Title""Skill Set""Experience Details"
are MAP keys. These are label names of fields in Zoho Recruit which will constitute the record.
"Richard""richard@zoho.com""+91 998877665""5""Assistant Manager""MCA""Working in UTS for 5 years"
are MAP values. These are values of fields in Zoho Recruit which will constitute the record.
"Candidates"
is the module in which the record will be created. It is of STRING data type.

Sample Response

The following is a sample success response:

{  
   "message":"Record(s) added successfully",
   "Created Time":"2015-11-19 18:04:55",
   "Modified By”:”john”,”Id":"1687000000116001",
   "Modified Time":"2015-11-19 18:04:55",
   "   Created By”:”john”
}

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

<variable> = <response_variable>.get("Id").toLong();

The failure response returned, when mandatory params are not specified, is of the following format:

{  
   "message":"Unable to populate data, please check if mandatory value is entered correctly.",
   "code":"4401"
}

Related Links

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com