In order to make decision trees that can help solve real-world problems, sometimes you need the ability to do more than just choose a path based on a finite set of choices. Logic Nodes provide an easy way to direct the tree to the appropriate destination based on where it has been previously, or what data it has collected during a session. Zingtree Logic Nodes give your decision trees extra intelligence.
Benefits of using Logic Nodes
- Agents need not remember anything that they clicked previously in a session. The tree itself remembers, so use logic to direct the tree to the appropriate information. For example, an Agent may have collected a customer's age at some point during the session. Use a logic node to direct the tree to information specific to if the customer is over or under a certain age.
- Use Logic to cut down on the number of clicks to get to a resolution. For example, in a product troubleshooting scenario, we may know if a combination of symptoms exists or does not exist, and what the likely solution may be. Get the Agent or Customer to that location quickly using logic.
In addition, we’ve found that many of our customer’s integrations are passing data variables into Zingtree, and there are situations where they would like to act on the value of those variables. Logic Nodes make this easy.
How Logic Nodes Work
When you edit or create a Logic Node, you’ll see something like this:
Logic Nodes test the value of your Zingtree variables with a series of rules and jump to a node when a condition is met. The rules are applied in order, so once a rule condition is met, the node assigned to the rule opens next. You can also assign a default node to jump to in case no rules apply.
In the example above, if the variable fruit equals banana, then Zingtree will open node #4, the “Banana” node. If Fruit is watermelon, then the default “Something Else” node opens.
Variables can be numeric or text, and the comparisons work for either data type. You can bring variables into your trees in several ways:
- As Data Entry variables.
- By assigning score variable values to button clicks.
- By passing them into the Zingtree URL as Merge Variables.
- By introducing them as return values from Zingtree Webhooks.
Note: Your choice of variables is shown in a drop-down list. If Zingtree hasn’t encountered a variable yet in one of the above scenarios, then it won’t appear as an option.
When editing your Logic Nodes, you can edit your rules as follows:
- Reorder rules by dragging them up and down with this tool. Remember that rules are evaluated from the top down. And when finding a match, the tree will jump to the node selected for that rule.
- Delete a rule by clicking on this:
- Select any existing variable from the Variables drop-down.
- Select an operator (=, ≠, <, >, ≤, ≥ ).
- Enter a value to perform the test upon.
- Choose the node to jump to if the rules match:
You must also enter a default node to jump to if no conditions are met.
Advanced Logic Nodes with Expressions
The default Simple Logic Node is designed to be easy to use and foolproof, but if you need more advanced operations you can take advantage of the Advanced option in the Logic Node Editor. You can use parenthesis, as well as comparison and logical operators to build complex rules.
Just choose the Advanced option, and you can enter expressions, like those shown below: