Conditions
Last updated
Last updated
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.).
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”.
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.
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.
Operators are used to perform operations on variables and values
We currently support these date operators:
Expects value of type yyyy-mm-dd (ISO format).
For example: 2021-01-14
Expects value of type day name with uppercase.
For example: Sunday
As used in CALL_START_TIME and sys.time
Syntax: HH:MM:SS