A conditional logic node is used to route users to different bot paths based on the user’s previous answer, user properties for that user, completion of a goal node, a webhook response, or the result of a script node. It serves to further tailor bot conversations using information Instabot has already gathered about the user as well as their previous responses in the conversation.
How to add a conditional logic node:
You can find the conditional logic logic node under the "Advanced" section of the Add a Node menu.
Examples:
1. Skip asking the user for information you already have
2. Check if the user has completed (or not completed) a bot goal
3. Check if the user answers a previous question in a certain way
4. Check if the user's email address is a business email or not (multiple checks in the same conditional logic node)
5. Check the calculated result from a script node
1. Skip asking the user for information you already have
A conditional logic node can be used to intelligently recognize when users have previously provided some information so that you can skip asking for that information again and avoid annoying the visitor.
In this example, we use a conditional logic node to check if the user has given their email address before and intelligently sends the user to different paths depending on the answer.
The conditional logic node (lime) will check if "Email" exists for this user already.
If "Email" does already exist for this user, we send the user down the 'True' path (teal) to a node that displays their email address and asks them to confirm if that email is still correct.
If "Email" does not already exist for this user, we send the user down the 'False' path (blue) to a node that asks for their email address, and stores it in the user's profile so we don't ask them for their email again in the future.
2. Check if the user has completed (or not completed) a bot goal
A conditional logic node can be used to intelligently recognize users who have previously completed a bot goal during this bot conversation, or one that occurred anytime in the past.
Below is a simple example that checks if this specific user has completed a goal node named "motivated/qualified buyer!".
The conditional logic node (lime) will check if this user has completed a bot goal named "motivated/qualified buyer!".
If the user has completed this goal, we send the user down the 'True' path (teal) to a node that starts the bot path for only motivated/qualified buyers.
If the user has not completed this goal, we send the user down the 'False' path (blue) to a node that starts the bot path for users who are not motivated/qualified buyers.
3. Check if the user answers a previous question in a certain way
A conditional logic node can be used to check anything about a user's answer to a previous answer.
Below is a simple example that checks if the user's answer to the question "ask for password" in this bot matches the correct passphrase of "knockknock".
The conditional logic node (lime) will check if the user's response matches the passphrase "knockknock" exactly.
If it matches "knockknock", we send the user down the 'True' path (teal) to a node that confirms the passphrase is correct.
If it does not match "knockknock", we send the user down the 'False' path (blue) to a node that tells the user the passphrase is incorrect.
4. Check if the user's email address is a business email or not (multiple checks in the same conditional logic node)
A conditional logic node can be used to check if a user's response to a previous node contains (or does not contain) a specific word or phrase. This use-case requires us to add multiple words or phrases that will be checked in the conditional logic node.
Below is a simple example that checks if the user's answer to the question "get business email" contains a non-business email domain.
The conditional logic node (lime) will check if the user's email address contains the phrase "gmail", or contains the phrase "yahoo", or contains the phrase "hotmail".
If the user's email address does contain any of those 3 phrases, we send the user down the 'True' path (teal) to a node that tells the user that their email is a personal email and that we need their business address.
If the user's email does not contain all of those 3 phrases, we send the user down the 'False' path (blue) to a node that confirms their email address is a business address.
5. Check the calculated result from a script node
A conditional logic node can be used to check the result of a script node (example use-cases for the script node).
NOTE - you will need to use the script node setResult() function to implement this use-case
Below is a simple example that uses a script node to calculate if the user's location is within the free delivery zone or not.
The conditional logic node (lime) will check if the user's location is in the free delivery zone.
If the script node returns "Yes" (user is in the delivery zone), we send the user down the 'True' path (teal) to a node that tells the user they are in the free delivery zone.
If the script node does not return "Yes" (user is not in the delivery zone), we send the user down the 'False' path (blue) to a node that apologies to the user that they are not in the free delivery zone.
Comments
0 comments
Article is closed for comments.