LogoLogo
  • Introduction to the Ebbot Platform
  • Ebbot Platform
  • Bot basics
    • Scenarios
    • Entities
    • Triggers
    • Training center
  • Scenarios
    • Cards and syntax
      • File Input
      • Text card
      • Input
      • Buttons
      • Image
      • File
      • Carousel
      • Location
      • List
      • Contact Agent
      • Rating request
      • Custom component
      • CoBrowsing
    • Transition
    • Card properties
  • AI Insights
    • Setup and Configuration
    • Using the Insights Dashboard
  • EbbotGPT
    • Knowledge
      • Data source transformer
      • Source types
        • File
        • Website scrape
        • Docx file
        • TOPdesk API
        • Sitevision API
        • SharePoint API
          • Create app with Sites.FullControl.All permission in Azure
          • Ebbot SharePoint Postman Guide
        • Confluence API
    • Configurations
    • Persona
    • GPT Evaluation
    • Embedder models
    • EGPT models
  • Custom vocabulary
  • Tutorials
    • Create your first scenario
      • Select a trigger
      • Add bot responses
  • Data Object
  • Release notes
  • For developers
    • Ebbot SDK
    • Safe Exchange API / Vault
    • Subdomain manager
  • EbbotGPT API
  • Chatbot & Live chat
    • Install chat widget
    • Chats API
    • Chat widget API
    • Datasource API
    • Sales tracking for live chat
    • Webhook
      • Incoming webhooks
      • Outgoing webhooks
    • SMS API
      • Authentication
      • Send SMS
      • Errors
      • Encoding
    • Python components
    • Intent detection (NLP)
  • Product guides
    • Product data feeds
    • Install guide
    • Product guide events
      • Product guide user events
      • Received events
      • Send events
    • API & webhooks
    • GA4 integration
    • Klaviyo integration
  • Messenger marketing
    • Install popup
    • API & webhooks
  • For chat agents
    • Ebbot Chat
      • Settings modal
      • Queue
      • Topbar Stats
      • Menu
        • Power-Ups!
        • Quick Replies
  • INTEGRATIONS
    • Ebbot Live Chat in Zendesk
      • Setup guide
    • Active Directory - SAML
    • Configure SAML in Azure
Powered by GitBook
On this page
  • Input string
  • Input pattern
  • Using the variable

Was this helpful?

  1. Scenarios
  2. Cards and syntax

Input

The input cards are useful when you need to ask the user for information and store it in a variable.

PreviousText cardNextButtons

Last updated 2 years ago

Was this helpful?

Input string

Ask the user about information and store it in a variable.

Syntax

[
	{
		"name": "<STATE_NAME>",
		"component": "ebbot_input_string",
		"properties": {
			"text": "<TEXT_MESSAGE>",
			"output": "<VARIABLE_NAME",
			"ask_again": false,
			"validation": {}
		}
	}
]

Example Usage

[
	{
		"name": "state_1613081714484",
		"component": "ebbot_input_string",
		"properties": {
			"text": "Whats your name",
			"output": "name",
			"ask_again": false,
			"validation": {}
		}
	}
]

Input pattern

Ask the user about information and match it against a regular expression before saving it to a variable. Useful when you need to validate the inputted informationen.

Syntax

[
	{
		"name": "<STATE_NAME>",
		"component": "ebbot_input_pattern",
		"properties": {
			"text": "<TEXT_MESSAGE>",
			"output": "<VARIABLE_NAME>",
			"ask_again": false,
			"pattern": "<REGEX_PATTERN>",
			"error_message": "<ERROR_MESSAGE>",
			"validation": {}
		}
	}
]

Example Usage

[
	{
		"name": "state_1613081823403",
		"component": "ebbot_input_pattern",
		"properties": {
			"text": "How old are you?",
			"output": "age",
			"ask_again": false,
			"pattern": "^[0-9]{2}$",
			"error_message": "Not a valid number",
			"validation": {}
		}
	}
]

Property

Description

text

The text message that should ask for the variable

output

Variable name

ask_again

Default value: false. Change to true if you like to always ask for the variable each time the card is triggered.

pattern

Regular expresson to match

error_message

Error message to prompt if the variable doesn't match the pattern

As default each input card is triggered only if the variable is empty. The second time the card is triggered it will jump to the next state. You can change this by setting "ask_again" to true.

Using the variable

You can use the collected variable in a response card by placing the variable name inside double curly brackets.

    "text": "Hello, my name is {{ name }} and I'm {{ age }} years old"

The variable is also accessible in a custom component.

def main(data):
    age = data['db']['age']
    name = data['db']['name']