The Zolar system is made up of tightly integrated apps orbiting around CRM. Today, we’re gonna show you how to exploit the Zoho Creator x CRM integration in a slightly unorthodox, but innovative way.
If you found this useful, check out our other Zoho training resources!
Suppose you’re dealing with a Creator Form that has complex requirements and acceptance criteria. On top of that, these requirements and criteria are subjected to periodic changes. To constantly hard-code these things into the script can be both tedious and unscalable.
This workaround establishes a dynamic link between Creator and CRM allowing users to simply set the criteria they desire on a record in a CRM custom module with 0 coding knowledge needed.
Fasten your seatbelts cause this will be a long ride.
First, we’re going to create a custom module in CRM. Then, we’ll create records in the module for each Course Type in which the questions and acceptance criteria will be configured via custom fields that mirror certain questions in the Creator Form.
Create a new module called “Qualification Criteria”, and in there, create records for each Course Type that you have.
This field will be used as a trigger to load certain course-specific picklist values on Creator, as well as for referencing the right course acceptance criteria.
Create custom fields in CRM for each question in your Creator Form that is part of your acceptance criteria. These custom fields can be divided to three types:
Use a picklist field for this and set the options as “Yes”, “No” and “N/A”. The value that you set here will be referenced by the Creator script as the acceptance criteria. If this question is not applicable to the Course Type, select “N/A” for the value.
Multi-select is used for questions with multiple selections where as long as the applicant selects one of the required answers, he/she is accepted
This allows you to dynamically populate picklist values in Creator from CRM as well as set a more customizable acceptance criteria. It should be an entire section on the record with a parent field (where the criteria filter kicks in), followed by a few child fields (for dynamic picklist population).
Here, users can determine whether applicants are required to select All/ Any 1/ Any 2/ Any 3/ None of the child field values to be accepted. If it is “N/A”, the script will bypass this qualification criteria.
These fields will later be programmed to populate the picklist values on the Creator Form. In the example below, if the applicant select “Any 1” of the “Applicable to Me” child fields, they will be accepted to the course. The beauty of this is that, if the criteria/value needs to be changed at any point of time, anyone can do it by simply reconfiguring the fields.
Note: “TAG” is used here to add tags on the applicant records later based on value(s) input on Creator to assist sorting.
This is arbitrary and may not be necessary for most but here it is in case you ever need it. The idea of a “Partner Field” is to account for situations where the standard acceptance criteria does not apply. For example, your school is working with several organizations that direct applicants to you . For these applicants, you would want to have a different set of criteria, or perhaps have some of them waived.
To account for these special cases, you can create separate records for the Course Type for specific Partners. For example, you have the general “Zoho Master Class” record that applies to all. Now, you can create a few customized records labelled “Zoho Master Class (Organization Name)” with the Partner Field filled with the Organization Name. In these records, you can have custom configurations set for different organizations.
Note: For this config, “Organization Name” should be a field on the Creator Form for applicants to input
Suggestion: You can even create a participation code field where students could obtain from the organizations. Upon input of the code, the “Organization Name” will be auto-populated as a hidden field.
Here’s where the magic happens!
Disclaimer: the script extracts below are made based on the case study. Please change the API names/modify the structure according to your application accordingly.
Create a workflow on Creator with “user input of a field” as the trigger.
qualificationrecord = zoho.crm.searchRecords("Qualification_Criteria","Course_Type:equals:" + input.Course_Type);
if(qualificationrecord.size() > 0)
{
q = qualificationrecord.get(0);
taglist = "";
applist = List();
if(q.get("Applicable_to_Me_1") != null)
{
applist.add(q.get("Applicable_to_Me_1").getPrefix("TAG:").trim());
taglist = taglist + "\"" + q.get("Applicable_to_Me_1").getPrefix("TAG:").trim() + "\"" + ":" + "\"" + q.get("Applicable_to_Me_1").getSuffix("TAG:").trim() + "\"" + ",";
}
if(q.get("Applicable_to_Me_2") != null)
{
applist.add(q.get("Applicable_to_Me_2").getPrefix("TAG").trim());
taglist = taglist + "\"" + q.get("Applicable_to_Me_2").getPrefix("TAG:").trim() + "\"" + ":" + "\"" + q.get("Applicable_to_Me_2").getSuffix("TAG:").trim() + "\"" + ",";
}
if(q.get("Applicable_to_Me_3") != null)
{
applist.add(q.get("Applicable_to_Me_3").getPrefix("TAG").trim());
taglist = taglist + "\"" + q.get("Applicable_to_Me_3").getPrefix("TAG:").trim() + "\"" + ":" + "\"" + q.get("Applicable_to_Me_3").getSuffix("TAG:").trim() + "\"" + ",";
}
if(q.get("Applicable_to_Me_4") != null)
{
applist.add(q.get("Applicable_to_Me_4").getPrefix("TAG").trim());
taglist = taglist + "\"" + q.get("Applicable_to_Me_4").getPrefix("TAG:").trim() + "\"" + ":" + "\"" + q.get("Applicable_to_Me_4").getSuffix("TAG:").trim() + "\"" + ",";
}
if(q.get("Applicable_to_Me_5") != null)
{
applist.add(q.get("Applicable_to_Me_5").getPrefix("TAG").trim());
taglist = taglist + "\"" + q.get("Applicable_to_Me_5").getPrefix("TAG:").trim() + "\"" + ":" + "\"" + q.get("Applicable_to_Me_5").getSuffix("TAG:").trim() + "\"" + ",";
}
if(applist.size() > 0)
{
show Applicable_To_Me;
}
for each a in applist
{
input.Applicable_To_Me:ui.add(a);
}
input.TagInfo = "{" + taglist.removeLastOccurence(",") + "}";
}
else
{
hide Applicable_To_Me;
}
Create another workflow on Creator with “successful form submission” as the trigger.
Based on the form input, the script will find the Qualification Criteria record based on the Course Type and check if it’s a “General” criteria or a special organization-specific criteria.
qualificationrecords = zoho.crm.searchRecords("Qualification_Criteria","Course_Type:equals:" + input.Course_Type);
usepartnercriteria = false;
for each r in qualificationrecords
{
if(r.get("Partner") != null)
{
if(Organization_Name = ifNull(r.get("Partner").get("name"),"Nope"))
{
usepartnercriteria = true;
partnercriteria = r;
}
}
else
{
criteria = r;
}
}
if(usepartnercriteria = true)
{
criteria = partnercriteria;
}
q = criteria;
applist = List();
result = "Accepted";
reason = "";
reason_admin = "";
If the Creator Form input to the question is not equivalent to the value selected in CRM, it will result in the applicant getting rejected. The reason for rejection is recorded in the respective variables.
Note: This is an example script. Change the field name (“Are_you_above_18”) accordingly.
if(q.get("Are_you_above_18") != "N/A")
{
if(Are_you_above_18 != q.get("Are_you_above_18"))
{
result = "Rejected";
reason = reason + "• You need to be above 18 years old to join this course." + "\n";
reason_admin = reason_admin + "• Is not above 18 years old." + "\n";
}
}
If the option(s) that the applicant select is/are not in the CRM multi-select field, it will result in rejection.
Note: This is an example script. Change the field name (“Reason_for_taking_this_course”) accordingly.
mainreason = q.get("Reason_for_taking_this_course");
if(mainreason != "N/A")
{
if(mainreason.size() > 0 && !mainreason.contains(input.Reason_for_taking_this_course))
{
result = "Rejected";
reason = reason + "• Your reason for taking this course is not what we are looking for." + "\n";
reason_admin = reason_admin + "• Selected the wrong reason for taking the course." + "\n";
}
}
This script accounts for every possible criteria the user may have set in CRM (All, Any 1/2/3, None, Any, N/A). Applicants will be rejected if they do not meet the criteria set.
if(q.get("Applicable_To_Me_Requirements") != "N/A")
{
if(q.get("Applicable_To_Me_Requirements") = "All")
{
iterator = {1,2,3,4,5}; // Change to the number of “child” fields you have in the “Applicable to Me” section in CRM
n = 0;
for each i in iterator
{
fieldname = "Applicable_To_Me_" + i;
if(q.get(fieldname) != null)
{
n = n + 1;
}
}
if(Applicable_To_Me.size() != n)
{
result = "Rejected";
reason = reason + "• You needed to select all of the 'Applicable to Me' options." + "\n";
reason_admin = reason_admin + "• Did not select all of the 'Applicable to Me' options." + "\n";
}
}
else if(q.get("Applicable_To_Me_Requirements") = "None")
{
if(Applicable_To_Me.size() != 0)
{
result = "Rejected";
reason = reason + "• You needed to select NONE of the 'Applicable to Me' options." + "\n";
reason_admin = reason_admin + "• Selected one of more of the 'Applicable to Me' options." + "\n";
}
}
else if(q.get("Applicable_To_Me_Requirements").contains("Any"))
{
if(Applicable_To_Me.size() < q.get("Applicable_To_Me_Requirements").right(1).toLong())
{
result = "Rejected";
reason = reason + "• You need to have chosen at least " + q.get("Applicable_To_Me_Requirements").right(1).toLong() + " of the 'Applicable to Me' options." + "\n";
reason_admin = reason_admin + "• Did not select at least " + q.get("Applicable_To_Me_Requirements").right(1).toLong() + " of the 'Applicable to Me' options." + "\n";
}
}
}
After iterating through all the criteria, you now have the final verdict of the application (pass/fail). From here, you can set the necessary acceptance/rejection actions.
if(result = "Rejected")
{
//Construct the fail message
failmessage = "Dear " + input.First_Name + " " + input.Last_Name + "," + "\n\n" + "Sorry, you were not accepted for the " + input.Course_Type + " Course. See below for the reason(s):" + "\n" + reason + "\n" + "Thank you for your application.";
failmessage_admin = "This Contact was just Rejected from an application for " + input.Course_Type + ". Here are the reasons:" + "\n" + reason_admin;
//Insert your rejection actions here
}
else
{
//Insert your acceptance actions here
}
Click here to copy the scripts. For more Zoho-wizardry, check out our GitHub page.
Book a free 30-minutes consultation with a Zoho expert or send us an email