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 6: Get responses from button clicks
  • Add buttons
  • Define responses after clicks
  • Step 7: Use Collect input blocks
  • Add a Collect input block
  • Step 8: Re-use a variable in the conversation
  • Test your Collect input
  • Lesson 3 recap
  • Coming next
  • 💬 Feedback

Was this helpful?

  1. start quickly
  2. Leadzy tutorial

3. Collect and display user input

In the previous lesson, we taught the bot to understand the user using Natural Language Processing (NLP). In this lesson, you'll learn how to gather user input for use in the conversation.

Previous2. Understand your usersNext4. Steer the conversation with Conditions

Last updated 1 year ago

Was this helpful?

On Chatlayer, collecting responses from your users can be done in 3 ways:

  • by using button clicks, which are better for closed questions, i.e. question with a limited set of possible answers.

  • by using Collect input blocks, which are better for open questions, i.e. question with an open-ended set of possible answers.

  • by using entities.

are a special NLP feature to detect information within the user message. You’ll discover more about them in another tutorial.

In this lesson, you’ll learn how to use button clicks and Collect input blocks to save information that can be reused later.

Step 6: Get responses from button clicks

A nice-and-easy way to get input quickly from your users is to add buttons to your chatbot.

We’ll create a block that asks whether if user is a new client, which will then give a different answer.

Add buttons

To add buttons to your bot:

  1. Go to your canvas.

  2. Drag and drop a Message block to your canvas.

  1. The block opens on the right hand side of the screen. Add a Buttons step to your block by clicking on it.

  1. As a Text message, add: Is it your first time shopping with us?

  2. Under it, click on Add button.

  3. Click on Go to.

  1. Under Title, add I’m new.

  2. Under Go to, create a Message block called ‘Welcome new user’. It is a placeholder where will come back to later in the tutorial.

  3. Repeat the same step to create another button called I’m a client already which goes to a new block that you’ll call Welcome returning user.

  1. Save your changes.

Your buttons are created! Let’s define what happens when they’re clicked now.

Define responses after clicks

Time now to modify elements on your canvas so that the right block leads to the right answer.

Change a block’s name and content

  1. From the canvas, double click on the last block you created to change its name:

    • Call it Check user type.

    • Click the Checkmark icon to save it.

  1. Open Welcome returning user and and change its content to: Great to see you again!

  2. Open Welcome new user and change its content to: Welcome then! It's your very lucky day: we have an extra 5% off for newbies!

The changes should look like so on your canvas:

Good, your user can now click on a button and have a response accordingly. Let’s make sure that this question follows the previous steps of the conversation.

Draw Go-to connections

  1. Draw a Go-to connection between Yes to discount and Check user type by holding down the mouse from the bottom-down node of your Yes to discount block.

  1. Test your bot. If everything works fine, your conversation should look like so:

You've successfully added buttons to your bot for answering closed questions. Now, let's learn how to pose more open-ended questions.

Step 7: Use Collect input blocks

Remember, our Bee bot project is a lead generation bot. We've reached the part of the bot flow where you'll collect people's details for future use.

On Chatlayer, you can gather open-ended responses during the conversation using Collect input blocks.

Add a Collect input block

  1. From your canvas, drag and drop a Collect input block.

  1. The block opens to the right-hand side.

  2. Under its Settings, change its name to Ask name.

  1. Come back to the block configuration and add a Text step.

  2. Fill it with the following message: What’s your name?

  3. Under Check if response matches, choose any.

  4. Under Destination variable, create a new variable that you’ll call userName.

  1. Under Go to, create the next block which will be a Collect input block called Ask email.

  1. Save your changes.

  2. Draw a Go-to connection between Welcome new user and Ask name.

  3. Draw a Go-to connection between Welcome returning user and Ask name.

At this stage, your canvas should look like so:

Step 8: Re-use a variable in the conversation

So that the user feels heard, we would like to re-use their name we’ve just collected in the previous block. To do so, we will re-use the {userName} variable.

To reuse a variable inside text:

  1. Open your Ask email block.

  2. Change its content so that it asks Great {userName}, and your email?

  3. Under Check if response matches, select @sys.email.

  1. Under Destination variable, create {userEmail}.

  1. As a Go-to, create a placeholder block called Next block.

  1. Save your changes.

  2. Fill your Next block with a placeholder text like This is a next block.

  3. Save your changes.

What you’ve created should look like so on your canvas:

What happens after we implemented something? Testing of course!

Test your Collect input

You can test your bot from anywhere in the conversation. We’re going to test the small piece of flow we’ve just created only, and see that the variable is indeed understood in the back-end.

Test from the middle of a flow

To test a bot from the middle of a flow:

  1. Click on the Ask name block.

  2. A toolbar opens. Click on the Test button.

  1. Test your piece of flow with the Collect input blocks. Your conversation should look like this:

Check the variable in the user session

The Debugger tab allows you to check your session data and see for yourself that a variable is indeed understood. To do so:

  1. Open the Test your bot window.

  2. Click on the Debugger icon at the top-right corner of the screen.

  1. Read down the Session data and see that {userName} and {userEmail} indeed exist and are filled with the right values.

Hurray! You’ve collected a response and used it inside your conversation, just like humans do.

Lesson 3 recap

In this lesson, you’ve learned how to:

Coming next

In the next lesson, we’ll explore how to use variables at any point of the conversation to steer it based on certain conditions.

💬 Feedback

A is a button that, when clicked, goes to another block in the conversation.

Your canvas offers flexible and multiple ways of navigating in it. Learn all about it .

A between block A and block B means that block B will happen right after block A in the conversation. Go-to connections are respresented as plain arrows on your canvas.

blocks are useful to get input from your user, check it, and save it as a variable that you can re-use later on.

are used to store any information the bot knows about a user. They can be reused inside text by using curly braces {}. Learn more about variables .

Chatlayer offers entities to recognize emails, phone numbers or URLs. They provide a time-saving way to build your Collect input blocks!

The is useful to detect where an issue comes from if something went wrong with the behavior of your bot.

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

Go-to button
here
Go-to connection
Collect input
Variables
here
pre-defined
Debugger
4. Steer the conversation with Conditions
this short form.
Entities
What will be built in this lesson.
Add a Message block to your canvas.
Add a Buttons step to your block.
Add a Go-to button to your block.
Fill your buttons with a title and a Go-to.
Change your block name directly from the canvas.
Each button clicked triggers a different block.
Draw Go-to connections from your canvas.
Test your buttons flow.
The Collect input block.
Add a Collect input block to your canvas.
Change a block name from its Settings.
Check if a Collect input responses matches a variable.
Create a Collect input from a Go to.
What your canvas should look like at this stage.
Save the user email under a variable.
Create the Next block from the Go to.
What your canvas should look like at this stage.
Test your block from the canvas.
Test your Collect input flow.
Open the Debugger from your Test window.
Check your variables in the Debugger.