Builder exit conditions Take Blip February 15, 2021 18:23 Updated In order to be able to condition a user's change of state, Builder provides exit conditions. An exit condition is made up of one or more rules and the target block identifier, if the condition is reached. The target block can be any of the existing blocks in the bot's conversation flow. Each rule consists of up to four structures: data source, operator, name of a variable and an expected value. When the data source of type Variable is selected, it is also necessary to add the name of the variable that will be analyzed in the condition. Data source A condition can use up to four different data sources to create a rule. They are: user input, value of a variable, intention or entity extracted from the last user input. Operator There are different types of operators for a rule. The table below shows all operators and their respective definitions: Operator name Description Exist Checks whether there is any value in the data source, whatever it may be. Equal to Checks whether the data source exactly matches the expected value Different than Checks whether the data source is different from the expected value. Contains Checks whether the data source contains the expected value. Begins with Checks whether the data source starts with the expected value. Ends with Checks whether the data source ends with the expected value. Bigger then Checks whether the data source is greater than the expected value. Less than Checks whether the data source is less than the expected value. Greater than or equal to Checks whether the data source is greater than or equal to the expected value. Less than or equal to Checks whether the data source is less than or equal to the expected value. Looks like Checks if the data source is similar to the expected value. (Using the Levenshtein function) Matches regex Checks whether the data source matches the regex standard set to the expected value. Expected value The expected value in the data source. This value can be text, number or even the pattern of a regex. Example 1: Imagine that, during any question, a bot needs to change the user's state according to his answer. The expected response values are 'yes' or 'no'. In this situation, the block that has the question will have two exit conditions: Condition 1 Data source: User input Operator: Same as Values: yes Target block: 1 - State Yes Condition 2 Data source: User input Operator: Equal to Values: no Target block: 2 - State No Example 2: Imagine that, during any question, a bot needs to change the user's state according to one of its context variables. Consider that the variable {{plan}} represents the user's plan, it was set in some previous state and can assume the values 'free' or 'premium'. In this situation, the block that has the question will have two exit conditions: Condition 1 Data source: Variable value Variable name: plan Operator: Same as Values: free Target block: 1 - Free state Condition 2 Data source: Variable value Variable name: plan Operator: Equals Values: premium Target block: 2 - Premium status Comments: an exit condition is made up of one or more rules. All rules for a condition must be true for the corresponding target block to be activated; the exit conditions of a Builder block are processed sequentially, until a true condition is reached. That is, it is necessary to register the conditions ordered from the most specific to the most generic; by default, every block has a preconfigured standard output (Fallback) condition. Although it is possible to change the standard output of any block, it is not possible to remove it. Related articles What types of content does the Builder support Builder variables How to send email by the chatbot through Builder How to create blocks in Builder Blip Desk Overview