Skip Conditions

Sometimes the user tells you the answer to certain questions earlier than expected. It is important to be prepared for these instances by combining the use of 'Data Actions' and 'Skip Conditions'. This combination will allow the flow to extract information with 'Data Actions' and skip the questions we already know the answers to with 'Skip Conditions'.

Before adding 'Skip Conditions':

User: I'd like to order one Cappuccino
Bot: Ok, what coffee would you like?
User: I already told you, one Cappuccino!
Bot: Ok, a cappuccino will be ready for pickup in 5 minutes.

After adding 'Skip Conditions':

User: I'd like to order one Cappuccino.
Bot: Ok, a cappuccino will be ready for pickup in 5 minutes.

Extract entities from the first input

The current stage of the 'User wants to order a coffee' flow doesn't extract the entity if you mention a coffee type in the first input. In order to do that we need to add another data action on entities but this time for the trigger:

  1. Open 'User wants to order a coffee' in edit mode.
  2. Select the 'Order a coffee' trigger node, this will open a trigger configuration panel to the right.
  3. Scroll down to the 'Data Actions' section and click on 'Add' followed up with 'Entity' to create a data action for our previously created entity.
  4. Paste in COFFEES_SERVED.
  5. Click on 'Add Mapping' below the entity name.
  6. Now use the drop-down menu below to determine the source coffeeType and the target orderedCoffeeType. This transfers the value from the source and merges it to the target.

Specify when outputs should be skipped

Now it's time to specify when output should be skipped:

  1. Select the 'Ask for coffee type' node, this will open the output configuration panel to the right.
  2. In the middle of the output configuration panel you will find the 'Skip Conditions' field, click on 'Add' to create a skip condition.
  3. Paste orderedCoffeeType into the 'Skip Conditions' field. This will be evaluated to true if the variable is set and to false if the variable is empty.
  4. Now use the drop-down menu beside 'Select a target' to determine how the flow processing should go on. In this case it should be 'User responds with coffee type'.
  5. Hit 'Save'.

What we have done here is to tell Teneo: if the orderedCoffeeType has a value when you reach the 'Ask for coffee type' output node, skip it and traverse the path 'User responds with coffee type' without waiting for an input from the user.

Test the scenarios

Now it's time to test the flow!

User: I'd like to order a coffee.
Bot: Ok, what coffee would you like?

User: A cappuccino, please.
Bot: Ok, a cappuccino will be ready for pickup in 5 minutes.

It is now possible to put all details into one single request:

User: Can I have a cappuccino please?
Bot: Ok, a cappuccino will be ready for pickup in 5 minutes.

What's next?

One of the new features for Teneo 6.0 is Data Actions. The next page is a quick explanation on what it is and how it works.

Was this page helpful?