Use if/then branches to customize the flow of conversations with a chatflow that includes a bot. You can add conditions to tell your bot to skip to a specific action based on the visitor's response, a contact property value, or agent availability. Set up an if/then branch when editing a bot's action or when adding quick replies to the bot action.
Set up an if/then branch
- Go to Conversations > Chatflows in your HubSpot account.
- Hover over the chatflow name in you want to add an if/then branch and click Edit or create a chatflow from Create chatflow.
- In the bot editor, select an action to modify.
- In the right panel, click the If/then branches tab.
- To set up rules for how the conversation continues after this action, click Add if/then branch.
In the left panel, create conditions for the actions. The logic can be based on the user's response, a contact property value, or agent availability.- Visitor's response: send a visitor down a specific path based on their response to the bot's question.
- Click the first dropdown and select visitor's response.
- Click the next dropdown and select an option to set the logic for the values you're looking for.
- Type or add any value you want to create conditions for, then press the Enter key to add it to your list.
- Contact property: send a visitor down a specific path based on a contact property value.
- Click the first dropdown to select contact property.
- Click the dropdown Select a property and select a property.
- Click the next dropdown and select an option to set the logic for the values you're looking for.
- Click the dropdown Add values and select property values, or type in any value you want to create conditions for, then press Enter to add it to your list.
- Agent availability (Sales Hub or Service Hub Professional or Enterprise only):
- Visitor's response: send a visitor down a specific path based on their response to the bot's question.
-
-
- Click the first dropdown to decide whom to route the visitor based on availability:
- Specific users and teams: send the visitor down a specific path based on the availability of a specific user(s) or team(s).
- Contact owner: send the visitor down a specific path based on their contact owner's availability.
- Click the first dropdown to decide whom to route the visitor based on availability:
- Click the last dropdown and select is unavailable or is available to set the logic based on whether the team member is available or unavailable.
-
- Click + to create additional rules.
- Click the dropdown Then go to to select the action to come next if none of the conditions in the if/then branch are met.
- Click Save.
Set up if/then branch for quick replies
- Go to Conversations > Chatflows in your HubSpot account.
- Select an action.
- Click the dropdown Quick replies in the right panel. Type to add answers that your visitor can select as responses to your message prompt. Press the Enter key to save.
- Next, click Go to action based on response to set up the if/then branch.
- Next to each response, click the Continue to next action dropdown menu and select an action.
- Click X next to action to remove the branch. This will also remove the option as quick reply response.
- After customizing your bot's logic, click the Otherwise, go to dropdown and select which action should come next if the visitor does not meet any of the conditions set.
- Click Save and continue, then review your branching logic.
- Click Save in the bottom left.