Conditions

You can use this node when your agent’s response is dependent on the user input, similar to "Classification". However, here we classify based on entities. You can either use a manually created entity or use a predefined system entity (sys.number, sys.names, etc.).

When to use Conditions

If you have a pizza delivery agent and the user chooses the size “large” he gets free drinks, you need a specific response for the parameter value “large”, and a different response for the values “small” and “medium”.

How to use Conditions

Click on “Add New Condition''. You will be able to fill in a name of the condition you'd like to create. In our pizza example, you'd call on condition "large" and another one "medium". You don't have to create one for "small" as the "else" in the conditions takes care of the leftover value.

Now, you're prompted to add the parameter you'd like to perform a condition on. The parameter should be the same as the one you are using in the “Collect Input” module before the “Conditions”. Now you can decide on the type of condition (e.g. == equal, <= smaller than, etc.). Then fill in the entity value in the box on the right.

Once done, you will notice the “Default” box on the right side of the “Conditions” module. This is the “else” function, which means, whenever the user says something that is not part of the entity values you specified in the conditions, it will go to the else/ “Default” box. You can specify the behavior of the “Default” by connecting it to another node.

When creating conditions for sys.confirmation entities, include one condition for “yes” and a different one for “no”. This should be done in order to differentiate the response of the virtual assistant to the “no” condition from the response of the virtual assistant to the default condition.

Creating Condition Groups

In case you want to create a condition that will take into account multiple different parameters and values in order to trigger a flow, you can do so by adding one or more sub-conditions.

Operator Types

Operators are used to perform operations on variables and values

1. Date operators

We currently support these date operators:

Date is After, Date is Before

Expects value of type yyyy-mm-dd (ISO format).

For example: 2021-01-14

Day of the week is, Day of the week is not

Expects value of type day name with uppercase.

For example: Sunday

2. Time Operators

As used in CALL_START_TIME and sys.time

Syntax: HH:MM:SS

Last updated