Creating Bots

Bots are made up of a series of questions and actions.

 

To add a new bot question or action:

  1. From the Settings menu, under the SimpleChat section select SimpleChat Bot Actions
  2. Click New
  3. Fill out the fields in the SimpleChat Bot Action form as follows, and then click Save

 

Main section:

  1. Question: The question that will be presented to the customer by the bot
  2. Topic: Ability to classify a group of questions associated with the same scenario
  3. Explanation: Text to display to the customer if the customer's answer is not recognized. The answers will be displayed again, up to the number of times defined in Max Retries
  4. Question Type: The type of question that will be sent to the customer or the action that will be taken, as detailed in the previous topic
  5. Template: If a template is selected, the text of the question will be determined by it, rather than by the Question field. Lets you set questions with dynamic parameters to be filled in by field values from the conversation or from related records.

Note: In previous versions, as long as the conversation is not created the pre-conversation bot was restricted to fields returned in previous questions

  1. Max Retries: The number of times the bot will try to repeat an illegally answered question before acting in accordance with the follow-up action defined for it in the Invalid Answer field. A zero value means that the bot will not repeat the question at all. If no value is filled the default value will be taken from the channel, and if there is no value the bot will keep repeating the question whenever the answer is invalid
  2. Answer Wait Time (Seconds): Waiting time for a customer to answer a question before the bot operates according to the follow-up action defined for it in the No Response If no value is filled the default value will be taken from the channel
  3. File Type: expected file types. Shown and required to fill in only if Question Type is set to File. Separate suffixes with a comma (example: "pdf,docx"). Note: The above is in addition to the general checks of authorized file types and file size
  4. Child Bot: The bot that will be activated. Shown and required to fill in only if Question Type is set to Run Child Bot
  5. Workflow Name: the on-demand workflow name that will be activated on the conversation record. Shown and required to fill in only if Question Type is set to Run Workflow

 

Follow-up Actions section:

This section defines how the bot will behave in different situations, such as when a valid or illegal response has been received, or a customer has not responded. In each of the situations the bot will progress in a different path, which will define the follow-up action it must perform when reaching this path, such as continuing to the next question or exiting the bot. The fields that are displayed in this section depend on the type of question selected.

  1. On Success: The follow-up action to take when a correct answer is received or when the bot continues correctly: Continue Bot, Exit Bot or Mark as Complete
  2. On Success Follow-up: The next bot question that will be presented to the customer if the customer answered the question correctly and On Success is set to Continue Bot
  3. Last Answer: Schema name of a field in a SimpleChat conversation that will be updated with a selected or filled answer, except when a static list option is selected. For file or image questions, the selected file extension will be filled out. Allows the bot to act on the answer. Note: If previous bot questions point to the same field only the last answer will be updated
  4. Destination Queue: The queue to which the conversation will be routed if the follow-up action is Exit Bot, and provided it is not a child bot. If empty, the default queue is taken from the channel
  5. No Options: The follow-up action to take when no results were returned for a dynamic question, so no options can be presented: Continue Bot, Exit Bot or Mark as Complete
  6. No Options Follow-up: The next bot question that will be presented to the customer if no answers to a dynamic question are returned and No Options is set to Continue Bot. Note: In this case the dynamic question is not displayed to the customer at all
  7. Invalid Response: The next action to take when the answer received is invalid and the number of repetitions of the question has passed: Continue Bot, Exit Bot, Mark as Complete or Cancel Activity
  8. Invalid Response Follow-up: The next bot question that will be presented to the customer when the answer received is invalid and the number of repetitions of the question has passed, and Invalid Response is set to Continuation Bot
  9. No Response: The following action to take when there is no response to the question and Answer Wait Time elapsed as defined in the question, or in the channel if the field is not filled in the question: Continue Bot, Exit Bot, Mark as Complete or Cancel Activity
  10. No Response Follow-up: The next bot question that will be presented to the customer when there is no response to the question and the time allowed for answering the question and No Response is set to Continue Bot

 

Dynamic Question section:

This section will be displayed only for dynamic questions (of type CRM View or FetchXML), and allows you to define how the options that will be presented to the customer will be retrieved from the system and how they will be presented to the customer.

  1. Entity: The schema name of the entity from which to retrieve the possible answers. Will only be displayed on the form if Question Type is set to CRM View
  2. View: The name of the view in the entity specified above by which to extract the possible answers. Will only be displayed on the form if Question Type is set to CRM View
  3. FetchXML: The FetchXML query to run to extract the possible answers. Will only be displayed on the form if Question Type is set to FetchXML
  4. Max Answers: The amount of answers that will be displayed in a dynamic question. The other options returned in the query will not be displayed
  5. Display Condition: Set the behavior of the system according to the amount of answers retrived (one or more, if no answer is found the question will not be displayed to the user and the bot will proceed to the follow-up operation No Options):
    1. Always: The options are always presented to the customer to choose from. Even if only one option is retrieved, it will be displayed for his selection
    2. On multiple options: If only one option is found it will be selected directly without being displayed to the customer, as if the customer selected it. Otherwise the options will be displayed for selection
    3. Never (multiple results are invalid): If there are several options they will not be displayed to the customer and the bot will proceed to to Invalid Response
    4. Never (multiple results are valid): The options will not be displayed to the customer, the first option found according to the display order of the view will be selected
  6. Filter Column: The schema name of the field in the view to which additional filtering should be applied in a dynamic question.

Note: If a filter was already defined for this field as part of the query definition, it will be replaced by a filter based on the answer value to the previous question. Instead, more complex filtering can be done as follows:

    1. If the text {PREV-ANSWER} is found in the view or in the FetchXML, it will be replaced by the value obtained from the previous question. This allows more flexibility in the filter compared to the full filter replacement when using the Filter Column, such as filtering the field by the previous answer value OR by some predefined value
    2. If the text {QUESTION-PATH} is found in the view or in the FetchXML, it will be replaced by the question path so far (question GUIDs). Enables performing complex operations in RetrieveMultiple that address not only the last question but also previous questions.
    3. If the text {ANSWER-PATH} is found in the view or in the FetchXML, it will be replaced by the answer path so far (selected record GUIDs). Enables performing complex operations in RetrieveMultiple that refer not only to the last answer but also to previous answers. Note: A question with no answers is not displayed and is represented as guid.empty (zeros)
    4. Just as dynamic field values ​​can be added to a SimpleChat Parameter entity, so can they be added to CRM View or FetchXML ​​from the conversation record or linked entity (including the ability to specify the field format to be displayed, for example for dates), thus allowing filtering by multiple fields and not just by a single field of the Filter Column. For more information on how to set dynamic fields, see How to defined dynamic values under the Setting up quick answer templates section below
  1. Answer Column: The schema name of the field in the selected answer whose value will be filled in the Last Incoming Message field in the SimpleChat Conversation. Note: For a picklist or lookup field or for a record key the value will also be filled. The code or guid will be filled in the Last Answer field
  2. Title Column: The schema name of the field in the view whose value will be displayed in the title of the card that will be shown in chat or Facebook

Note: If filled, its value will be filled in the Last Incoming Message field in the SimpleChat Conversation instead of the value from the Answer Column field. Required when the Answer Column field points to the record key and therefore contains a guid

  1. Subtitle Column: The schema name of the field in the view whose value will be displayed in the subtitle of the card that will be shown in chat or Facebook
  2. Image Column: The schema name of the field in the view whose value holds the URL that points to the image to be displayed on the card that will be shown in chat or Facebook
  3. Link Title Column: The schema name of the field in the view whose value is displayed in the link to be displayed on the card that will be shown in chat or Facebook
  4. Link Column: The schema name of the field in the view whose value holds the URL of the link to display on the card that will be shown in chat or Facebook

 

Location section:

This section will be displayed only for dynamic questions (of type CRM View or FetchXML), and allows you to filter and sort the results returned in the query by distance from the last location received from the customer, collected in a previous bot question of type Location, and to display for the returned results their distance from the last location received from the customer.

Important: Filtering and sorting is limited to the first 5,000 results returned in the query. Additional results will not be returned and will not be displayed!

  1. Filter By Distance: Check to filter the query results by a given distance radius in relation to the last location from the customer. Results without placement will also be filtered out from the list
  2. Filter Radius: The maximum radius from the last location provided by the customer according to which the results will be filtered
  3. Sort By Distance: Check to sort results by distance from the last location instead of the sort order of the query. Results without placement will be displayed at the end of the list (unless filtering is enabled then they will be removed)
  4. Sort Order: Sort the results by distance so that the closest or farthest is displayed first
  5. Display Distance: Check to display the distance from the location provided along with the query results
  6. Display Format: How the distance is displayed next to each result. Note: Subtitles can only be used on channels where cards can be displayed, such as WebChat and Facebook
  7. Longitude Column: The schema name of a floating point field in the view where the longitude of the record's location is stored
  8. Latitude Column: The schema name of a floating point field in the view where the latitude of the record's location is stored
  9. Measurement Unit: The unit of measure in which the distance will be measured, Miles or Kilometers

 

Answers section:

This section will be displayed for each type of question for which you can define among other things selection from a fixed list of options. If the customer chooses one of the fixed answers, the bot will proceed according to what is defined in the selected answer's On Success path.

  1. Answers to Choose From: A fixed list of possible answers to be display to the customer for selection

Must be defined for a Static List type question

Static answers can also be defined for a dynamic question. If defined, they will be displayed after the dynamic options and you can check which answer is selected, dynamic or static. For example, you can dynamically retrieve the customer's list of open cases, and allow him to choose which open case he is addressing or let him choose another static option "Create a new case on another topic". If no dynamic option is returned the question will not be displayed at all, even if static options were defined for that dynamics question

In the same way, static answers can also be defined in open-ended questions, such as a numeric question. The answers will be displayed for selection and the customer can choose one of them instead of typing his answer. For example, one might ask "When did the incident happen?" and expect a date, but also allow a choice of static answers such as "Today" and "Yesterday" or "I do not know". Note: In numeric questions, only answers with an empty Condition field will be selected, as explained below

In the same way you can set static responses even to a bot action of requesting a location or uploading a file or image, for example requesting "Please send a driver's license photo" and expect to receive an image, but also allow selection from static responses such as "I do not have a driver's license" or "I do not have it on me "

  1. Hidden Answers: Designed to skip bot stages. Each question can also include answers that will not be displayed to the customer, that belong to the levels further down the tree. If the customer manually types one of the hidden answers, the system will identify the answer and behave accordingly

Important: In channels that display an answer number to choose from, such as WhatsApp and SMS, this number will be "taken" so if static answers are combined do not expect a question that may receive this number as an answer, or else the bot will treat the answer as if the customer selected the static answer.