Chatlayer Documentation
Get in touchAbout Chatlayer
  • Welcome
  • What's new
  • Send feedback
  • start quickly
    • Leadzy tutorial
      • 0. Introduction
      • 1. New bot, new block
      • 2. Understand your users
      • 3. Collect and display user input
      • 4. Steer the conversation with Conditions
      • 5. Empower your bot with Actions
      • 6. Set up a channel and publish your bot
    • Templates
      • Banking
      • E-Commerce Returns
      • E-Bike Shop
      • E-Scooter Support
      • Feedback
      • Find Nearest Location
      • GPT
      • 🆕Gym
      • Job applications
      • Knowledge base AI template
      • Lead generation
      • 🆕NPS
      • Restaurant
      • Retail
  • navigation
    • Analytics
      • Dashboard
      • Customers
      • Conversations
      • User flow
      • Intents
      • 🆕Funnels [Beta]
    • Bot builder
      • Flows
        • Canvas functionalities
        • Collaborate with team members
        • Manage your flows
        • 🆕[Beta] Export and import flows
      • Bot dialogs view
      • Translations
      • Events
    • NLP
      • Dashboard
      • Intents
      • Expressions
      • Entities
      • Train
      • NLP settings
      • Improve
    • Knowledge base AI
      • Add content to your KBAI
      • Build your KBAI flow
      • Use your KBAI source URL in a button
      • Use tags to limit your KBAI content
      • 🆕Use Tables to store your KBAI questions
      • 🆕Manage handover where KBAI is unsatisfactory
    • History
      • Conversations
      • Execution logs
      • Versions
    • Channels
    • Tables
      • Create a table with records
      • Column types
      • Operate on your records
        • Insert record
        • Update record
        • Retrieve record
        • Delete record
      • API
    • Settings
      • Bot settings
      • Offloading
      • Variables
      • Voice
      • Import/Export
  • build your bot
    • Conversation design
      • Plan your bot
      • Conversation design workflow
    • Flow logic
      • Blocks
        • Message
        • Condition
        • Collect input
        • Action
      • Go-to connections
    • 🆕Emulator
    • Tips & best practices
      • Route your flow depending on the time
      • Improve the Not understood block
        • How to create better not understood messages
        • Not understood counter
        • Not understood Google search
      • Go to previous block
      • Recognizing a returning user
      • Skip introduction message
      • Route your flow depending on the channel
      • Reuse flows
      • Connect two bots to each other
  • understand users
    • Natural language processing (NLP)
      • Basic NLP concepts
      • Detect information with entities
        • Match entities
        • Contextual entities
        • System entities
        • Composite entities
      • NLP best practices
        • Word order and diversity of expressions
      • AI intent booster
      • Train your NLP
      • Context
      • NLP import & export
      • Sentiment analysis
    • Languages
      • Supported languages
      • Make your bot multilingual
      • Change language within the conversation
  • set up channels
    • Add a channel to your bot
    • All channels
      • 🚨Facebook Messenger [Deprecated soon]
        • Facebook Admin Removal
        • Facebook Webview Whitelisting
        • Facebook Messenger API updates for Europe
      • 🚨Google Assistant [Deprecated soon]
      • Webhook
      • Web
        • 🚨Web V1 [Deprecated]
          • Customize web widget
          • Live example web widget
        • 🆕Web V2
          • 🆕From Web V1 to V2
          • 🆕Web V2 methods and options
    • Sinch Conversation API
      • Configure your Sinch Conversation API
      • 🆕 Make the most of RCS with Carousels
      • WhatsApp Business API
  • integrate & code
    • API calls
      • Configure your API integration
      • Advanced API features
      • V1 API Reference
      • Custom integrations 101
    • Code editor
      • [Example] Sending data to Airtable (POST)
      • [Example] Retrieving data from Airtable (GET)
      • [Example] Making SOAP requests
    • App integrations
      • Airtable
      • Freshdesk
      • Freshdesk Messaging
      • 🆕Gmail
      • Intercom
      • Mailgun
      • OpenAI: GPT-3, ChatGPT and GPT-4
      • Salesforce
      • 🆕Slack
      • Topdesk
      • Zendesk Support
      • Zendesk Sunshine (beta)
    • 🆕Expression syntax
    • Human handover & live chat
      • Sinch Contact Pro
      • #Interact
      • Genesys Cloud
      • Offloading Webhook
      • Salesforce Service Cloud
      • Sparkcentral by Hootsuite
      • Zendesk Chat
    • Chatlayer messages specifications
  • Publish
    • Publish your bot
      • Publish a flow
  • Analyze & maintain
    • Analytics definitions
    • Data retention
    • Maintenance
    • Session
    • Track events for analytics
  • VOICE
    • 🆕Send bot response as audio
    • Voicebots
      • Create a voicebot
      • Voicebot-specific actions
      • Test your voicebot
      • From chat to voice
  • access & support
    • Identity & Access
      • Single Sign-On (SAML SSO)
    • Billing & subscription
    • Get in touch
    • Chatlayer glossary
    • SaaS Regions & IP Ranges
    • Status
    • Debug your bot
      • No correct response
      • Collect input not working
      • Video isn't working
Powered by GitBook
On this page
  • Step 8: Check a variable in a Condition block
  • Get variables under button clicks
  • Add a Condition block
  • Organize your flow
  • Lesson 4 recap
  • Coming next
  • 💬 Feedback

Was this helpful?

  1. start quickly
  2. Leadzy tutorial

4. Steer the conversation with Conditions

In the previous lesson, you learned how to get user input and re-use it as variables. Let's see now how the conversation can be steered in different directions based on variables.

Previous3. Collect and display user inputNext5. Empower your bot with Actions

Last updated 1 year ago

Was this helpful?

Apart from being re-used inside the conversation itself, variables can help the bot steer the conversation in different directions, by using Condition blocks.

Step 8: Check a variable in a Condition block

Our Bee bot now asks if the user is new, then asks the user information.

We would like Bee to give a slightly different answer depending on if the user is new or returning. To do so, we’ll need a Condition block that checks a {userType} variable.

Get variables under button clicks

We’ll save a {userType} variable under button click of the Check user type block. This variable can have either the value returning or new.

To save a variable under a button click:

  1. Open the Check user type block.

  2. Under the first I’m new button, click on + Add a variable and create the variable userType.

  1. Add the value new.

  2. For the second button, do the same with the value returning.

  1. Save your changes.

Now, when a user clicks on one of these buttons, the system will remember the {userType} variable. Let's utilize this variable within a Condition block.

Add a Condition block

We aim to create a Condition block that evaluates the {userType} variable and provides a different response based on its value.

To add a Condition block:

  1. Open the Next block block.

  2. Go to its Settings.

  3. Change its Type to Condition.

  1. You’ll get a warning message. Click Yes, change type.

  2. Under Bot dialog name, change the block name to Route userType.

  1. Go back to its configuration, and click on the + to add your first condition.

  2. Fill in the block as follows, using the equal case insensitive operator:

    • If {userType} = new,

      • then Go to Send email new user. You can create this new block directly from the text field.

    • Else if {userType} = returning,

      • then Go to Send email returning user. You can create this new block directly from the text field.

    • Else:

      • Go to Error occurred.

Your window should look like this:

  1. Save your changes.

Your canvas looks a bit messy now, and that’s totally normal. Let’s organize it a bit:

Organize your flow

To re-organize your flow when it looks messy, click on the Auto-layout button at the bottom-right corner of your canvas.

What we created should look like this now:

Lesson 4 recap

Congratulations! In this lesson, you’ve learned how to:

Coming next

Coming next, we’ll see how to connect your bot to 3rd party providers so that you leverage your bot’s functionalities.

💬 Feedback

blocks enable your bot to redirect the user to another block depending on the conditions of the session variables, following an if-then logic.

The Error occurred block is a triggered when an API integration fails to complete a certain request, or when Chatlayer considers your bot to be blocked in a loop.

Your feedback on the tutorial means the world to us! Please, let us know what you think through

Condition
default block
5. Empower your bot with Actions
this short form.
What we will build in lesson 4.
The Condition block type.
Create a variable under a button click.
Make your Go-to buttons capture variables.
Change a block dialog type from its Settings.
Change a block name from its Settings.
Fill your Condition block with conditions.
What your canvas should look like at this point.