Custom Functions

Custom Functions


Zoho Recruit Custom functions help you to update data in related Recruit modules or third-party applications by executing simple program scripts. When a record matches the workflow criteria, workflow engine automatically triggers the custom function and updates the Recruit records. With custom functions, you can program scripts using Deluge Script (powered by Zoho Creator), associate them with workflow rules, and automate the recruitment process. See Also Deluge Script - Reference Guide .

Business Scenario

Candidate screening is a time-consuming process. In order to simplify, you can create a custom function with Zoho Recruit. By doing this, the recruiter can prioritise their follow-ups and other engagements with candidates.

Ideal Users

  • Recruit Administrators who set up workflow rules for Users
  • Programmers with REST API and Deluge Script skills
Availability

Profile Permission Required: Users with the "Manage Workflow" permission can access this feature.

Set Up Custom Functions

You can set up custom functions in three steps:

  • Create a custom function.
  • Associate custom function to a workflow rule.
  • Test custom functions integration.

To create a custom function

  1. Go to Setup > Automation > Actions > Custom Function.
  2. In the Workflow Custom Functions page, click the Configure Custom Function.
  3. In the Configure Custom Function page, select a function from Gallery, existing function or write a new one using Deluge Script.

  4. Click Save.

 To associate custom function to a workflow rule

  1. Click Setup > Automation > Actions > Rules.
  2. In the Workflow Rules page, click the Create Rule.
  3. In the Create New Rule tab, specify workflow rule parameters.
  4. Select Custom Function, under Instant Actions.
  5. Now select the custom function to be triggered.
  6. Click Save.

 To test the custom function integration

  1. Add test data in Zoho Recruit according to your workflow rule criteria.
  2. Check for the data received from Zoho Recruit via custom function, in your application.
  3. Modify your custom function code in Zoho Recruit, if data is not received or if there is a data mismatch.
  4. Continue this test until you obtain the required data from Zoho Recruit to your Application.

Important Notes

  • You can associate up to 6 (1 Instant Action and 5 Time-Based Actions) custom functions per workflow rule.
  • You can execute only 5000 lines (Statements) in a single custom function call.
  • You can transfer data for a maximum of 10 Recruit fields from Zoho Recruit to third-party applications using custom function.
  • You can retrieve data from other Apps to Zoho Recruit using custom function.
  • You must update the API ticket regularly according to limits in third-party applications.
  • You will not receive any email notification, if the custom function integration stopped functioning due to any issue in a third-party API.
  • If there is any failure while connecting to Zoho Creator service, custom function will send the second notification after 15 min. Thereafter, the system will not send any notifications for that particular workflow trigger. Errors returned from Zoho Creator are shown under Reason for Failures section.
  • If you exceed the maximum count per day, the system will not send remaining custom function notifications to third-party applications and will notify the failure to Administrator. 
  • Zoho Recruit will the send the data in following standard format for Date and Date Time fields to third-party applications:
    • Date: yyyy-MM-dd
    • Date Time: yyyy-MM-dd hh:mm
  • Limits for Custom Functions:
    • Calls per Day - 10000 calls/day or 200 calls per user license for the org. (whichever is lower)
    • Integration Tasks - 25000 Zoho API calls /day using deluge.
    • Get Data  - 25000 calls/day
    • Post Data  - 2 calls/day
    • Send Email - 1000 emails/day

Business Scenario

Candidate Screening Summary:
Candidates can be screened according to the custom set criteria. By mapping the arguments of the custom function to rank the candidates. We have taken the Phone number, E-mail address, Job title, Skill set and industry details of the candidates to rank them. 

  • id: Choose "Candidate Id" column from the list of fields. 
  • phone: Choose "Phone" column from the list of fields. 
  • email: Choose "Email" column from the list of fields. 
  • title: Choose "Job Title" column from the list of fields. 
  • skillSet: Choose "Skill set" column from the list of fields. 
  • resume: Choose "Is Attachment Present" column from the list of fields. 
  • authtoken: (Custom Value) Provide the authentication token required to access your Zoho Recruit account using an API call

Candidate status like: Junk Candidate, Unqualified, Rejected, Waiting for Evaluation will be assigned when the given set of criteria is met. 

The Deluge Script for the above scenario goes like this:

if(phone.length() == 0 && email.length() == 0 && title.length() == 0 && skillSet.length() == 0 && resume == "false")
{
status = "Junk Candidate";
}
else if(phone.length() == 0 || email.length() == 0)
{
status = "Unqualified";
}
else if(title.length() == 0 && skillSet.length() == 0 || resume == "false")
{
status = "Rejected";
}
else
{
status = "Waiting-for-Evaluation";
}
updateMap = Map();
updateMap.put("candidateStatus",status);
updateMap.put("authtoken",authtoken);
updateMap.put("candidateIds",id.toString());
updateMap.put("scope","recruitapi");
updateMap.put("version","2");
response = postUrl("http://recruit.zoho.com/recruit/private/json/Candidates/changeStatus%22,updateMap);

To configure this custom function:

  • Log in to Zoho Recruit.
  • Setup > Automation > Actions > Rules > Create Rule.
    You can create a new rule by specifying Module and Rule Name. 

          

  • Click Next.
  • Choose when you want to execute this rule. Now select Create or Edit option under execute based on a record action.
  • Click Next.
  • Choose to which records you want to execute the rule. Select Records Matching the condition option and set the criteria.
      
  • Click Next.
  • Now choose Custom Function as Instant action.

             

  • In the Call Custom Function pop-up, Click on +New Deluge to create or add Custom function.

            

  • Click on the Gallery to use the pre-defined Custom Function.
  • Click on Configure given against the Custom Function name- Screen Candidates.
  • Edit the Title, Description and Deluge Script as per your requirements. 

            

  • Click on Edit Parameters and map the arguments by choosing from the dropdown list.
  • Click on Save.
  • As you finish editing your function, click on Save Script before saving the function.
  • Click Save and Proceed and you will be taken to the Workflow page with Custom function added to the flow you have created.
      
  • The Custom Function created will be run when you create or edit any candidate record.

Refer Error Codes

When the execution of custom function fails, one of the following error messages will be displayed in Zoho Recruit:

 HTTP Status Codes

  • 400 Bad Request - Often missing a required parameter.
  • 401 Unauthorized - No valid API key provided.
  • 402 Request Failed - Parameters were valid but request failed.
  • 404 Not Found - The requested item doesn't exist.
  • 500, 502, 503, 504 Server errors - Error in the third-party application.
  • Error Code 1 - Temporarily not able to connect to the API server. Check API server logs, firewalls settings for requests sent from Recruit.

 Custom Errors

  • Internal process failure - When the custom function is not executed due to errors in processing of the script.
  • Day limit reached - When the company has reached the maximum limit for the day.
  • Deluge Script - When the execution of workflow triggers fail due to errors in Deluge Script.

    • Related Articles

    • Custom Functions

      Custom functions help in automation where procedural logic is required, which cannot be implemented with the default actions such as, Tasks, Webhooks, etc. With custom functions you can automatically update the data in the related Zoho Recruit ...
    • Manage Custom Functions

      Custom functions allow users to develop and execute user-defined functions using Deluge. You can execute simple program snippets to automate processes, or integrate with third-party or Zoho applications.    Business Uses for Custom Functions Custom ...
    • Custom Functions

      The Manage Business icon in the top menu bar is your go-to for managing all of your booking preferences. This page discusses Custom Functions. Aside from the default flow of a customer booking, you can define additional workflows at each stage of the ...
    • Functions

      Functions are the building blocks for developing an extension. They come handy for all server side customization. Sigma executes functions without additional infrastructure cost. External function calls can be done using rest APIs. You have to ...
    • Custom functions

      Automate your issues workflow using Custom Functions. What Is a Custom Function? A custom function is a piece of code that can be used for automating a process. You can write your own function in Deluge and call it from one or more business rules. It ...