How to suppress/ignore default PARAMS prompt if using Context Handler Function
I am creating a Zobot script using Zia Skills for Lead Generation. This includes an Action that collects some user inputs to give user specific outputs through the Execution Function.
For example, the problem goes like this:
Once the action is triggered, the visitors are asked few questions. One of the questions is whether they have a appeared for a particular exam. If they select YES (single select input), then and only then are they prompted for that exam score, if they select NO the Context Handler Function should suppress the exam score Param. How do I go about solving this issue?
Please Refer the code below (Especially Line no. 49 to 62
PARAM NAMES:
programname
countryname
compexamname
compexamscore
engexamname
engexamscore
Context Handler Function:
- result = Map();
- if ( programname == null )
- {
- responseText = "Which Programs/Specializations do you wish to pursue?";
- response = Map();
- response.put("action","reply");
- response.put("replies",{{"text":responseText,"field_name":"siq_programname"}});
- prompt = Map();
- prompt.put("param_name","programname");
- prompt.put("data",response);
- result.put("prompt",prompt);
- }
- else if ( countryname == null )
- {
- responseText = "In which Country/Region do you wish to study? (select upto 3 options)";
- response = Map();
- response.put("action","reply");
- response.put("replies",{responseText});
- response.put("input",{"type":"multiple-select","options":{"United States","Canada","UK and Ireland","Europe","Australia and New Zealand","Other Countries"},"max_selection":"3"});
- prompt = Map();
- prompt.put("param_name","countryname");
- prompt.put("data",response);
- result.put("prompt",prompt);
- }
- else if ( countryname == "Other Countries" )
- {
- responseText = "Please enter the Country Name:";
- response = Map();
- response.put("action","reply");
- response.put("replies",{{"text":responseText,"field_name":"siq_countryname"}});
- prompt = Map();
- prompt.put("param_name","countryname");
- prompt.put("data",response);
- result.put("prompt",prompt);
- }
- else if ( compexamname == null )
- {
- responseText = "Which of these Competitive Exams have you given?";
- response = Map();
- response.put("action","reply");
- response.put("replies",{responseText});
- response.put("input",{"type":"select","options":{"GRE","GMAT","SAT","None of these"}});
- prompt = Map();
- prompt.put("param_name","compexamname");
- prompt.put("data",response);
- result.put("prompt",prompt);
- }
- else if ( compexamname != null && compexamscore == null )
- {
- if ( compexamname != "None of these" )
- {
- responseText = "What is your Total " + compexamname + " score?";
- response = Map();
- response.put("action","reply");
- response.put("replies",{{"text":responseText,"field_name":"siq_compexamscore"}});
- prompt = Map();
- prompt.put("param_name","compexamscore");
- prompt.put("data",response);
- result.put("prompt",prompt);
- }
- }
- result.put("todo","prompt");
- return result;
Thanks in advance.
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.