WFH Tip: 18 What are Questions in the Zobot and how are they defined?

WFH Tip: 18 What are Questions in the Zobot and how are they defined?

  • The SalesIQ Scripts platform in the Zobot has a response type called "questions" that is an array of objects in which each question is an object. You can include any number of questions in each array. 
  • It accepts only a collection as the value. 
  • The collection, in turn, must have at least one map which should include a name for the question that will be unique for a context, the text which will be the question that will be sent to the visitor and optional "input" or "suggestions". 
  • These questions can be defined in the response of all the four handlers (Trigger, Message, Context, Failure) of the Zobot scripts if the response "type" is "context. 
  • You can define questions inside your scripts for the bot to collect details from the visitor, display information along with images to the visitor, etc. 
  • Each question map in the questions array has the following keys: 
    • name 
    • replies 
    • input 
    • suggestions 


How can you define questions in the Zobot? 


Sample Code: 
  1. response = Map(); 
  2. response.put("questions",questions); 
  3. response.put("action","context"); 
  4. response.put("context_id","personalInfo"); 
  5. question1 = { 
  6.              "name":"email", 
  7.              "replies":[ 
  8.                            { 
  9.                                 "text":"Please enter your registered email address", 
  10.                                  "field_name":"siq_email", 
  11.                                  "validate":{"format":"email","error":["Please enter a valid email address"]} 
  12.                             } 
  13.                            ] 
  14.                     }; 
  15. question2 = { 
  16.              "name":"phone", 
  17.              "replies":["Please enter your registered phone number"] 
  18.                     };

To learn more about connections, start building your own Zobot right away. We also have Sample Scripts that use connections.

For more information, check out our Help Documentation.

Related Topics:

Regards,
Michelle