Chatflows

Use if/then branches in chatflows

Last updated: November 4, 2019

Applies to:

Marketing Hub  Professional, Enterprise
Sales Hub  Professional, Enterprise
Service Hub  Professional, Enterprise

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.

Please note: free users and Starter users cannot add custom conditions to their bot.

Set up an if/then branch

  • In your HubSpot account, navigate to Conversations > Chatflows.
  • Hover over the chatflow you want to add an if/then branch and click Edit. If the chatflow hasn’t been created, learn how to create a 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.

  • Create conditions for this action. You can base the logic 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 menu and select visitor's response.
      • To set the logic for the values you're looking for, click the next dropdown menu and select an option.
      • Type in 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 menu and select contact property.
      • Click the Select a property dropdown menu and select a property.
      • To set the logic for the values you're looking for, click the next dropdown menu and select an option.
      • Click the Add values dropdown menu 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): send a visitor down a specific path based on a team member's availability.

Please note: you can only select users from the dropdown menu who are assigned to a paid Sales Hub or Service Hub seat

      • Click the first dropdown menu and decide who to route visitor's to 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). Click the Add a user or team dropdown menu and select the checkbox(es) next to the user(s) or team(s) to include.
        • Contact owner: send the visitor down a specific path based on their contact owner's availability. Click the New visitor fallback dropdown menu and select a fallback option for any new or unassigned visitors who start a conversation.
    • To set the logic based on whether the team member is available or unavailable, click the last dropdown menu and select is unavailable or is available.
  • Click AND to create additional rules.
  • Click the Then go to dropdown menu to select the action to come next if none of the conditions in the if/then branch are met.
  • Click Save.

To view the path visitors will follow when they meet a certain condition, select an if/then branch response. The actions that follow will display in the chatflow builder.if-then-branch-options 

Set up if/then branch for quick replies

If you're using quick replies in a bot action to display a series of preset responses during a conversation, set up if/then branches based on these quick replies to create a tailored experience for your visitors.

  • In your HubSpot account, navigate to Conversations > Chatflows.
  • Select an action to modify.
  • In the right panel, click the Quick replies dropdown menu and type to add answers that your visitor can select as responses to your message prompt. Press the Enter key to save each one.
  • After you enter your quick reply responses, click Go to action based on response to set up the if/then branch.

quick-reply-branch-builder

  • Next to each response, you can customize the action to come next in the bot's flow. By default, the bot will send the visitor to the next action, but to customize which action follows, click the Continue to next action dropdown menu and select an action. quick-reply-options
  • Click X next to an action to remove the branch.

Please note: if you click X to remove the branch, you will also remove the option as quick reply response. You'll need to re-add the quick reply response in order for it to display during a conversation.

  • After customizing your bot's logic, click the Otherwise, go to dropdown menu 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.

When a visitor engages with the bot on your website, they will go to the next action specified in your if/then branching logic based on which quick reply response they select.