SmartbotPro
  • Smartbot Pro – messenger marketing tool
  • Most important
  • Mini-course
    • Registration and personal account
    • Initial scripting tools
    • Creating the first script
    • Users and collection of information
    • Applications, variables and managers
    • Data validation
    • Collection of applications for a webinar within Telegram
    • Testing unpublished scripts
    • Newsletters
    • Template "Test with a set of points"
    • Statistics
    • Interface hacks
  • Beginning of work
    • Registration in the service
    • More about scripts
    • How to add messenger
      • Adding Telegram
        • Adding a bot to a group chat in Telegram
      • Adding ВК
      • Adding Viber
      • Connecting a channel to a script
      • Linking a social network account
  • Scripts
    • Basics
      • Create a script
      • Script templates
      • Editor interface
      • Publishing a script
      • Script testing
      • How the script is chosen
    • Script events
      • Message from user
      • No appropriate script
      • First message
      • VK Events
      • Webhook
    • Actions
      • Send a message
        • Buttons
      • Process message
      • Extract data
      • Change context
      • Write to statistics
      • Send Notification
      • Switching to another script
      • Working with the user
      • Set variable
      • Scheduled transitions
      • Run SmartQuery
    • Conditions
      • Condition
      • Condition with options
      • Conditions of VKontakte
    • Variables
      • Special Variables
      • User variables
      • Global variables
      • Variable %ref%
    • Acceptance of payment
    • Telegram bot menu
    • Integrations
      • Google-таблицы
      • http request
      • amoCRM
      • Get Course
      • Yukassa for receiving payments
    • Reactions
  • Newsletters
  • Settings
    • Projects
    • Cabinets
  • Information sections
    • Statistics
    • Users
  • SmartQuery
    • Introduction
    • Language syntax
    • Function Reference
  • The documents
    • Privacy Policy
    • Terms of service
    • Subscription and rates
Powered by GitBook
On this page
  • Option 11
  • Option 2
  1. Mini-course

Data validation

PreviousApplications, variables and managersNextCollection of applications for a webinar within Telegram

Last updated 2 years ago

Now let's find out if it is possible to set up data validation using the example of a phone number.

Option 11

In the "Process message" block there is a checkbox "Use template".

This way I can choose the format of the response that I expect from the user. For example, you can set the following pattern: "My phone is ". Whatever the user writes in place between "<" and ">" must follow a certain format. It can be a number, email, phone number:

If the user writes a message that does not match the template, an error exit will be triggered. Graphically, it is indicated by an exclamation point. Write a hint to the user:

Now the bot will explain to the user what is expected of him, and will again wait for a response.

Option 2

You can make it easier: add a button to send the phone. This is a native Telegram button that allows the user to send the number associated with the account. Please note that this option is available only in Telegram.

Now there is no need for data validation: