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
  • Retrieve record(s)
  • Display the retrieved record(s)

Was this helpful?

  1. navigation
  2. Tables
  3. Operate on your records

Retrieve record

Learn how to use the retrieve record operation on your table by using a gym bot example

PreviousUpdate recordNextDelete record

Last updated 11 months ago

Was this helpful?

Retrieving a record from your table means that it allows bot query and retrieve information from an existing record.

To exemplify this, we will use a gym booking bot that uses a Table to retrieve information about available gym classes from the table, enabling users to view and select classes to book.

This means that from a table like this, you'll be able to retrieve only specific records, e.g. only the Zumba classes:

className
classTeacher
isBooked

Zumba

Jenny

None

Yoga

Sergine

None

Zumba

Chloé

None

Retrieve record is an operation which doesn't edit your table. It just filters out which records we're looking at inside a conversation. It's usually combined with another operation, e.g. retrieve a record then update a record.

Retrieve record(s)

To retrieve a record:

  1. Make sure that you have a well-defined . For this example, we'll use gym booking table with those fields:

    • ClassName: Name of the fitness class.

    • ClassDay: Date of the class, in a consistent format (e.g., YYYY-MM-DD).

    • ClassTime: Start time of the class, using a clear format (e.g., HH:MM AM/PM).

    • ClassTeacher: Name of the instructor leading the class.

    • IsBooked: Status field indicating whether the class is booked ('None' or 'Available' by default, updated to customer's name upon booking).

  1. Determine the point in your bot flow where users will request to view available classes. For this example, after users selected which class they want to book, a retrieve record operation will happen so that the bot finds that class in the table.

  2. Choose Retrieve record from the list of operations.

  3. Select the table that you want to update. For this example, we'll select Gym class booking.

  1. Under the Operation config section, click on + Add filter to set up the query to filter records based on the value(s) or one or more column(s). For this example:

    • We filter out by looking at the isBooked column. If the isBooked cell equals None, it means that the class is available for bookings. It means that we'll only retrieve classes that are available.

    • Additionally, we incorporate a filter for className to match the user's selection, ensuring that the query returns classes that align with the user's preference. It means that if the user is interested in yoga classes, then we'll only retrieve yoga classes and not other ones.

  1. Under Limit, set a limit to the number of query results. In this example, we'll limit the results to 2. This ensures that the bot displays a concise list of available classes for the user to choose from.

  2. If you need to skip a few numbers of records from your retrieve operation, fill in the field under Skip. For this example we won’t allow to skip the first number of records from results, so no need to do anything there.

  3. Under Destination variable, assign the retrieved results to a variable. For this example we'll name it available_class. This variable will keep retrieved classe(s) to use them inside the conversation.

  1. Click Save.

Display the retrieved record(s)

Above, you've learned how to retrieve records from a table, which in this example are available gym classes. To display those retrieved records in the conversation:

  1. For this example, let's call this block Display classes.

  2. Add a Buttons step.

  3. To concisely convey class availability, format your button titles to include the day and time of each class. Use the {variableName[index].values.fieldName} variable structure to embed the retrieved class information:

    • {available_class[0].values.classDay} at {available_class[0].values.classTime}.

    As a practical example, if the first returned class is on a Monday at 10 AM, your button might be titled "Monday at 10 AM".

  4. Given that we've set the operation to return up to two classes, ensure your message includes a button for each available option. Duplicate the formatting approach for the second button, substituting [0] with [1] to access the second item in the array:

    • {available_class[1].values.classDay} at {available_class[1].values.classTime}

    This ensures both options are presented for user selection.

  1. Click Save.

  2. It's crucial to check the functionality of your Retrieve record operation to ensure data is retrieved and displayed correctly. Use the bot's emulator or a live test environment to simulate user queries for available classes.

  1. Verify that the bot retrieves and displays the correct class information based on the availability in the table.


to your flow at the point that you've defined.

Introduce a new designed to let users pick from the available classes. This block serves as the juncture where users can visually see and select their preferred class timing.

Looking for a quick and easy bot template to play with Tables? The is a representative use case.

Add a Table operation
Message block
Gym bot
table
A table that stores gym class bookings.
Select the correct table.
Define selection criteria to retrieve records from your table.
Configure your limit and destination variable when retrieving records.
Using variable to Retrieve record from the table in a buttons
Test your Retrieve record flow
The Retrieve record operation works on the table as expected.