Fetch Records from Zoho Recruit
The zoho.recruit.getRecords() task can be executed to retrieve existing records from any of the supported modules of Zoho Recruit. By placing it in the required workflow section of Zoho Creator, the process of retrieving records from Zoho Recruit can easily be automated as per requirement. Lets say you have a Zoho Creator form where you need to retrieve records from Zoho Recruit for further action such as iterating them. You can execute zoho.recruit.getRecords() task in the required workflow section which will return the response containing the records in a map format. Further details on how to execute this task are explained below.
- Job Openings
- Client Contacts
<response> - is the map variable returned by Zoho Recruit as response.
<moduleName> - name of module in Zoho Recruit from where the records will be fetched. (mandatory)
<fromIndex> - is the starting index of the records that need to be retrieved. Default value is 1. If fromIndex and toIndex are not specified the above task will fetch a maximum of 20 records only otherwise it will fetch upto 200 records.
<toIndex> - is the last index of the records that need to be retrieved. Default value is 20. Maximum value allowed is 200.
Following is a sample script that can be added in a Zoho Creator form to retrieve existing records from Zoho Recruit. Let's say we have a Creator form where we need to fetch records from Zoho Recruit to perform an iteration. You can add the following script in required workflow section of the Creator Form so that whenever this form is loaded, edited or submitted etc, records existing in Zoho Recruit's specified module are retrieved accordingly. In this case, the module is "Candidates". When the following script gets executed, records from Zoho Recruit are fetched as specified by the index numbers. Using the following sample code, records from index number 2 to index number 9 are fetched(both inclusive).
response - is the map variable returned by Zoho Recruit as response.
Candidates - name of module in Zoho Recruit where the record will be added.
2 is the starting index of the records that are going to be fetched.
3 is the last index of the records that are going to be fetched.
Response returned by Zoho Recruit as map: