Prompt Field Types
A Prompt Field is a type of input field that’s used to capture information from a user in a structured and organized manner. It can include various types of input fields such as Single Choice, Multiple Choice, Number, Email Address, Phone Number, and more. The Prompt Field also includes validation messages and code validation, which helps ensure that the user inputs the correct type of information. This means that if the user inputs an invalid value, they will be notified with an error message and prompted to re-enter the correct information.Prompt Fields | Description & Extracted Information |
---|---|
SingleChoice | Extracts a Single Choice from a finite list of possible Values Variable Type: String |
MultipleChoice | Extracts one or multiple choices from a finite list of possible Values Variable Type: String |
Boolean | Extract a Boolean (On/Off) from the Query Variable Type: Boolean |
Confirmation | Confirm a Yes/No question with a Boolean from the Query Variable Type: Boolean |
Number | Extracts a Number from the Query Variable Type: Number |
EmailAddress | Extracts a full Email Address from the Query Variable Type: String |
PhoneNumber | Extracts a Telephone Number and optionally the Country Code from the Query Variable Type: String |
FullAddress | Extract the Full Address from the Query Variable Type: Object |
Price | Extracts a Price from the Query Variable Type: Number |
RawInput | Extract the Input provided by the User, without any processing Variable Type: String |
Percentage | Extracts a Percentage from the Query Variable Type: Number |
Quantity | Extract a Quantity from a Query Variable Type: Number |
Color | Extracts a Color as both HEX and RGB codes from the Query Variable Type: Object |
TimeMeasurement | Extracts a time measurement as (ns, mu, ms, s, min, h, d, week, month, year) Units Variable Type: Number |
WeightMeasurement | Extracts a Weight Measurement as (mcg, mg, g, kg, oz, lb, mt, t) Units Variable Type: Number |
CronSchedule | Extracts a one-time or recurring schedule as a CRON Expression from the Query Variable Type: Object |
OperatingSystem | Extracts the name of an Operating System (Windows, OSX, IOS, Android, Linux) Variable Type: Object |
QuantityofPeople | Extracts the Number of People in a Query Variable Type: Number |
VolumeMeasurement | Extracts a volume measurement as (mm3, cm3, ml, l, kl, m3, km3, tsp, Tbs, in3, fl-oz, cup, pnt, qt, gal, ft3, yd3) Units Variable Type: Number |
TemperatureMeasurement | Extracts a Temperature Measurement as (C, K, F) Units Variable Type: Number |
Person | Extracts the name of a person(first and last names) Variable Type: Object |
DateTime | Extracts date and time relative to the current date Variable Type: Date |
Single Choice
The Single Choice is a type of input field that presents the user with a list of options to choose from. The user can only select one option from the list, and their choice is then stored as a value in a variable. This variable can be used later in your Workflow for further processing.TipIf the user enters text instead of clicking a button, the AI will check the text for any matching button labels. If it finds a match, it will handle the input as though the user had clicked that button.
- Create a new capture information card.
- Set the Type property to Single Choice.
- Set the Variable name property to the name of the Workflow variable you want to use to store the selected option.
- Set the Prompt message property to a message that lists the available options for the user to choose from.
- Click on the Advanced Configuration to add Choices.
preferredTransportation
Workflow variable. You can then use this variable to tailor the conversation based on the user’s choice.
For example, if they choose bike, you can ask follow-up questions related to biking or suggest some scenic bike routes.
You can also use the value of the preferredTransportation
variable in transitions. For example, if the user selects car, you can move them to a node related to car-related services or if they choose bus, you can move them to a node related to public transportation schedules.
Multi Choice
The Multi Choice type is a way to gather information from users by presenting them with a list of options to choose from. Users can select one or more options from the list. This type of capture information is useful in scenarios where you want to give users a set of choices to pick from, like selecting the toppings for a pizza or the colors for a shirt. It’s a quick and easy way to collect information from users without having to ask them to type out their answers. Steps to use Multi Choice Field- Create a new capture information card.
- Set the Type property to Multi Choice.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted values.
- Set the Prompt message property to a message that provides a list of choices for the user to select from.
- Click on the Advanced Configuration to add Choices.
pizzaToppings
Workflow variable. You can then use this variable in other parts of your Workflow to make decisions or take actions based on the user’s response.
For example, if the user selects pepperoni and mushrooms, you can use the pizzaToppings
variable to customise their order and display a message like Your pizza with pepperoni and mushrooms is on the way!
Boolean
Boolean type extracts a binary value from the user’s input and saves it in a variable of type Boolean. The extracted information can include values like true and false, agree and disagree, accept and decline, or any other binary values. Steps to use Boolean Field- Create a new capture information card.
- Set the Type property to Boolean.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted Boolean value.
- Set the Prompt message property to a message that prompts the user to enter a binary value.
- Optionally, you can edit the Choices property if you want to customize the binary values that the user can select. By default, the choices are Yes and No. When the user provides an input, the system will extract either a true or false value based on whether the user selects Yes or No.
Confirmation
The Confirmation type is a way to ask the user to confirm or agree to something. For example, you might use this type to confirm a user’s purchase, agreement to terms and conditions, or confirmation of an appointment. When the user responds, the Confirmation type extracts a binary value (either true or false) and saves it in a variable. This allows you to use the user’s confirmation or agreement later in your bot’s logic. Steps to use Confirmation Field- Create a new capture information card.
- Set the Type property to Confirmation.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted Boolean value.
- Set the Prompt message property to a message that prompts the user to confirm or agree to something.
- Optionally, you can edit the Choices property if you want to customize the binary values that the user can select. By default, the choices are Accept and Decline. When the user provides an input, the system will extract either a true or false value based on whether the user selects Accept or Decline.
Number
TheNumber type extracts a numerical value from the user’s input and saves it in a variable of type number. The user can enter any numerical value, like a whole number or a decimal, and the bot will recognize and store it as a number. This can be used for calculations or any other purpose where a numerical value is needed. Steps to use Number Field- Create a new capture information card.
- Set the Type property to Number.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted numerical value.
- Set the Prompt message property to a message that prompts the user to enter a numerical value.
productQuantity
variable as either an integer or decimal value. You can then use this variable in other parts of your Workflow to calculate the total cost of the purchase.
For instance, if the product costs $10 per unit and the user entered 3 as the product quantity, you can calculate the total cost in an Execute Code Card as follows:
Email Address
The EmailAddress type is used to extract an email address value from the user’s input and save it in a variable of type string. This allows you to use the extracted email address in other parts of your bot’s logic, such as sending an email confirmation or storing the email address for future use. The email address can be in any valid email address format, including with special characters such as dots, hyphens, and underscores. Steps to use Email Address Field- Create a new capture information card.
- Set the Type property to EmailAddress.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted email address value.
- Set the Prompt message property to a message that prompts the user to enter an email address.
userEmail
Workflow variable as a string. You can then use this variable in other parts of your Workflow to add the user to your newsletter subscription list or perform other actions based on the user’s response.
Phone Number
In this section, we’ll discuss the PhoneNumber capture information type in Botpress. This type of capture information extracts only the phone number representing the user’s input, excluding the country code, and saves it in a variable of type string. Steps to use Phone Number Field- Create a new capture information card.
- Set the Type property to PhoneNumber.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted phone number value.
- Set the Prompt message property to a message that prompts the user to enter a phone number.
FullAddress
FullAddress extracts the full address information from the user’s input and saves it in a variable of type object. The extracted information contains the country, city, street, zip code, and house number. Steps to use Full Address Field- Create a new capture information card.
- Set the Type property to FullAddress.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted address information.
- Optionally, set the Prompt message property to a message that prompts the user to enter their address.
- Save the card.
{{Workflow.variableName.country}}
, {{Workflow.variableName.city}}
, {{Workflow.variableName.street}}
, {{Workflow.variableName.zip}}
, and {{Workflow.variableName.number}}
.
Example
Let’s say you want to capture the user’s full address to use in a shipping process. You can create a new capture information card with the following properties:
shippingAddress
Workflow variable. You can then use this variable in other parts of your Workflow to complete the shipping process, such as sending an email confirmation to the user with their shipping details.
Here’s an example of how you can use the extracted information in a message:
Price
Price extracts the price information from the user’s input and saves it in a variable of type number. The extracted information contains the amount of money, regardless of the currency. Steps to use Price Field- Create a new capture information card.
- Set the Type property to Price.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted price information.
- Set the Prompt message property to a message that prompts the user to enter the price.
- Optionally, set the Default value property to a default price to be used if the user doesn’t provide one.
- Save the card.
paymentAmount
Workflow variable. You can then use this variable in other parts of your Workflow to process the payment, such as sending the payment information to a payment gateway.
Here’s an example of how you can use the extracted information in a message:
Raw Input
The RawInput extracts the user’s input as it’s and saves it in a variable of type string. The extracted information can include any type of user input, including text, numbers, and special characters. Steps to use Raw Input Field- Create a new capture information card.
- Set the Type property to Raw Input.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted user input.
- Set the Prompt message property to a message that prompts the user to enter their input.
issueDescription
Workflow variable as a string value. You can then use this variable in other parts of your Workflow to log the issue or escalate it to the relevant team for resolution.
You can create a message node with the following text:
Answer from a Knowledge Base
The Raw Input card can also be used to search for answers in a Knowledge Base (KB) and answer the user’s question directly. You can have it search across all available KBs or limit the search to a specific KB. Searching All Knowledge Bases To enable the search across all available Knowledge Bases when the user asks a question:- Create a new capture information card with the Type set to Raw Input.
- Make sure the “Search in all KBs” option is selected.
- In the Prompt message property, enter a message that encourages the user to input their question (e.g., “What would you like to know?”).
- Store the user’s input in a variable by setting the Variable name property (e.g.,
userQuery
) if you want to use it later.
- Create a new capture information card with the Type set to Raw Input.
- Deselect the “Search in all KBs” option.
- Provide the name of the KB you wish to search in the “KBs to search in” input field.
- In the Prompt message property, enter a prompt directing the user to ask their question.
- Set the Variable name property to save the user’s query (e.g.,
userQuerySpecific
) if you want to use it later.
Percentage
The Percentage extracts the decimal representing the percentage from the user’s input and saves it in a variable of type number. The extracted information can include values like 50%, 75%, or any other percentage. Steps to use Percentage Field- Create a new capture information card.
- Set the Type property to Percentage.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted percentage value.
- Set the Prompt message property to a message that prompts the user to enter a percentage.
discountPercentage
Workflow variable as a number. You can then use this variable in other parts of your Workflow to calculate the discount or take actions based on the user’s desired discount.
For example, if the user entered 50%, you could calculate the discount amount as follows:
Quantity
The Quantity extracts the quantity information from the user’s input and saves it in a variable of type number. For example, if the user inputs “I want to buy 5 apples” or “Give me 5 kilograms of apples”, the function will extract the number 5 and store it as a numerical value, without regard to the different units of measurement used. This allows you to work with the quantity of the item, regardless of how the user expressed it. Steps to use Quantity Field- Create a new capture information card.
- Set the Type property to Quantity.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted quantity information.
- Set the Prompt message property to a message that prompts the user to enter the quantity.
{{Workflow.variableName}}
**.
Example
Let’s say you want to capture the user’s desired quantity of a product. You can create a new capture information card with the following properties:
productQuantity
Workflow variable as a number. You can then use this variable in other parts of your Workflow to calculate the total price or to check the stock availability.
Here’s an example of how you can use the extracted information in a message:
Color
The Color type extracts the color information from the user’s input and saves it in a variable of type object. The extracted information contains the colour name, hexadecimal code, and RGB values. Steps to use Color Field- Create a new capture information card.
- Set the Type property to Color.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted colour information.
- Set the Prompt message property to a message that prompts the user to enter a colour.
{{workflow.variableName.colorName}}
, {{workflow.variableName.hexCode}}
, and {{workflow.variableName.rgb}}
.
Example
Let’s say you want to capture the user’s favourite colour to use in a marketing campaign. You can create a new capture information card with the following properties:
favoriteColor
Workflow variable. You can then use this variable in other parts of your Workflow to customise your marketing campaigns, such as using the colour in promotional materials or emails.
Here’s an example of how you can use the extracted information in a message:
Time Measurement
The TimeMeasurement type extracts date/duration values from the user’s input and save it in a variable of type Number after converting it to the chosen format. The extracted information can include values like next week, in a month, after two months, in 15 days, in 2 working days, etc. This information can be useful for scheduling appointments, setting reminders, and much more. Steps to use Time Measurement Field- Create a new capture information card.
- Set the Type property to Time Measurement.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted time measurement value.
- Set the Prompt message property to a message that prompts the user to enter a date/duration value.
ns
(nanoseconds)mu
(microseconds)ms
(milliseconds)s
(seconds)min
(minutes)h
(hours)d
(days)week
(weeks)month
(months)year
(years)
You can choose any of these formats based on your requirement.
Example
Let’s say you want to schedule a meeting with a user based on their availability. You can create a new capture information card with the following properties:
meetingTime
Workflow variable as a number value in the chosen format. You can then use this variable in other parts of your Workflow to schedule the meeting accordingly.
If the user is available at the specified time, you can schedule the meeting and confirm the details with the user. If not, you can ask for their availability again.
This will allow you to schedule meetings with users based on their availability and improve their experience with your service.
Weight Measurement
The WeightMeasurement extracts weight information from the user’s input and saves it in a variable of type number after converting it to the chosen format. The available formats aremcg
, mg
, g
, kg
, mt
, oz
, lb
, t
.
Steps to use Weight Measurement Field
- Create a new capture information card.
- Set the Type property to Weight Measurement.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted weight value.
- Set the Prompt message property to a message that prompts the user to enter a weight.
mcg (microgram) | mg (milligram) | g (gram) | kg (kilogram) |
---|---|---|---|
mt (metric ton) | oz (ounce) | lb (pound) | t (ton) |
userWeight
Workflow variable as a number value. You can then use this variable in other parts of your Workflow to decide what to do based on the user’s response.
You can ask the user if they want to proceed if their weight is over a certain limit or if it falls under a certain range. You can also display the weight measurement in different formats by using a formatted node.
This will display the user’s weight in the desired format and provide relevant information based on their response.
Cron Schedule
The CronSchedule type takes a specific interval of time that a user inputs and convert it into a format that a computer program can understand. This interval can be things like every 5 minutes or once a day at 3pm. The cron schedule then saves this interval in two ways: first, in a format that follows the cron convention (which is a standard way of representing time intervals in programming); and second, as a Boolean value that indicates whether the interval should be repeated or not (for example, if the interval is “every 5 minutes,” the cron schedule would set the repeatable property to true, whereas if the interval is “once a day at 3pm,” the cron schedule would set the repeatable property to false). This makes it easier for developers to program applications that need to run certain tasks at specific intervals of time. Steps to use cron schedule field- Create a new capture information card.
- Set the Type property to cron schedule.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted cron interval.
- Set the Prompt message property to a message that prompts the user to enter the desired interval value.
cronSchedule
Workflow variable as an object with two properties: the cron value, which represents the extracted interval in a cron format, and the repeatable Boolean value, which indicates whether the interval should be repeated or not.
You can then use this variable in other parts of your Workflow to set up the event trigger according to the user’s input.
Operating System
The OperatingSystem type extracts the operating system the user is using from their input and saves it in a variable of type object. This information can be useful for troubleshooting issues specific to certain operating systems or for tailoring responses based on the user’s operating system. Steps to use Operating System Field- Create a new capture information card.
- Set the Type property to Operating System.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted operating system.
- Set the Prompt message property to a message that prompts the user to enter their operating system.
Quantity of People
The QuantityofPeople type extracts a number representing the quantity of people from the user’s input and saves it in a variable of type Number. The extracted information can include values like 1, 2, or 3. For example, if you are building a reservation system for a restaurant, you can use the QuantityofPeople type to ask the user how many people will be dining, and then save that number as a variable. This variable can then be used to ensure that the restaurant has enough seats available for the group, or to calculate the total cost of the meal based on the number of people. Steps to use Quantity of People Field- Create a new capture information card.
- Set the Type property to QuantityofPeople.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted number value.
- Set the Prompt message property to a message that prompts the user to enter a number representing the quantity of people.
Volume Measurement
The VolumeMeasurement extracts a volume value from the user’s input and saves it in a variable of type number. The extracted value can be converted to one of the several available formats based on the user’s choice. Steps to use Volume Measurement Field- Create a new capture information card.
- Set the Type property to VolumeMeasurement.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted volume value.
- Set the Prompt message property to a message that prompts the user to enter a volume value.
Cubic millimeters (mm3) | Cubic centimeters (cm3) | Milliliters (ml) | Centiliters (cl) |
---|---|---|---|
Deciliters (dl) | Liters (l) | Kiloliters (kl) | Cubic meters (m3) |
Cubic kilometers (km3) | Teaspoons (tsp) | Tablespoons (Tbs) | Cubic inches (in3) |
Fluid ounces (fl-oz) | Cups (cup) | Pints (pnt) | Quarts (qt) |
Gallons (gal) | Cubic feet (ft3) | Cubic yards (yd3) |
liquidVolume
Workflow variable as a number value. The value will be converted to the format specified by the user. You can then use this variable in other parts of your Workflow to perform calculations or use the value in responses to the user.
For example, you could use the liquidVolume
variable to calculate the price of the liquid based on the volume and price per unit of volume, or you could use it in response to the user like Thank you for ordering {{workflow.liquidVolume}}
ml of liquid. Your order will be delivered soon.
Temperature Measurement
The TemperatureMeasurement type extracts a temperature value from the user’s input and saves it in a variable of type Number. The extracted temperature can be in any of the available formats: Celsius, Kelvin, or Fahrenheit. Steps to use Temperature Measurement Field- Create a new capture information card.
- Set the Type property to Temperature Measurement.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted temperature value.
- Set the Prompt message property to a message that prompts the user to enter a temperature value in any of the available formats.
bodyTemperature
Workflow variable as a Number. You can then use this variable in other parts of your Workflow to decide what action to take based on the user’s body temperature.
If the user’s body temperature is above the normal range, you can send them to a doctor’s appointment node. If not, you can proceed with the conversation as usual.
This will display a message based on the user’s response and the action you decide to take based on their body temperature.
Person
The Person type is used to extract the name of a person from the user’s input, such as when you ask the user for the name of a contact or a customer. Once the user enters the name, the Person type extracts the first and last names and saves them in a variable of type Object. This extracted information can be used in other parts of your Workflow to personalize messages or perform actions specific to that person, such as sending them an email or adding them to a mailing list. Steps to use Person Field- Create a new capture information card.
- Set the Type property to Person.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted name information.
- Optionally, set the Prompt message property to a message that prompts the user to enter their name.
- Save the card.
Datetime
The Datetime capture information type in Botpress. This type of capture information extracts a date or duration value from the user’s input and saves it in a variable of type Object. The extracted information can include values like next week, in a month, after two months, in 15 days, 2 working days, or any other date or duration value. Steps to use Datetime Field- Pick the Datetime Capture Information Card from the Cards.
- (Optional) - Add a question to ask. (for example: when would you like to book an appointment?)
- Store the output in a variable.
bookingDate
Workflow variable as an object. You can then use this variable in other parts of your Workflow to decide when to book the room or provide available dates for the user to choose from.
You can check the user’s preferred booking date against your available dates to ensure the room is available for booking on that day. If the room isn’t available, you can offer other available dates or suggest another hotel that’s available on the preferred date.
Formatting Date
Wait for User Input
The Wait for User Input type is used to pause the Workflow of a conversation until the user enters a specific input. This can be useful when you want to wait for the user to enter a specific input before proceeding with the conversation. Steps to use Wait for User Input Field- Drag and drop the Wait for User Input card into your node.
- You can use
{{event.preview}}
to display the fetched user’s response after the user enters the input.
File Upload
The File Upload type allows users to upload a file through the bot interface. Once the file is uploaded, the bot captures the URL of the uploaded file as a string variable.Configuration Steps:
-
Enable File Upload in Webchat Settings:
- Navigate to the Webchat settings in Botpress Studio.
- Under the General tab, find the option labeled Allow user file upload.
- Toggle the setting to Enabled.
-
Set Up the Capture Information Card:
- In the Capture Information card, select File as the Type of value to extract.
- Define the Question to ask the user, such as “Please upload the file you want to share.”
- Specify the variable in Store result in where the file URL will be stored (e.g.,
workflow.filePath
).
Example:
If the user uploads a file, the bot will save the file’s URL to the specified variable. You can then use this variable in subsequent Workflows, such as storing the file URL in a database or sending it to an API.Custom Prompt Fields
Entity - Regex
The Entity - Regex type of capture information uses regular expressions to extract specific patterns of information from the user’s input and saves it in a variable of type String. It’s particularly useful for capturing sensitive information like credit card numbers, which have distinct patterns. Steps to use Regex Field- Create a new entity in the Entities section of your Botpress instance with a custom regular expression that matches the pattern of the information you want to capture.
- Create a new capture information card.
- Set the Type property to Entity Regex.
- Select the entity you created in Step 1 from the Entity dropdown.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted information.
- Set the Prompt message property to a message that prompts the user to enter the information you want to capture.
Entity - List
In this section, we’ll discuss the Entity - List capture information type in Botpress. This type of capture information extracts specific pieces of information from the user’s input based on matching it with entries (or synonyms) in a custom entity list. This can be useful when you want to capture specific information like a person’s name, location, or product name. Steps to use List Field- Create a new entity list under the library -> entities section.
- Add entries to the entity list and their synonyms.
- Create a new capture information card.
- Set the Type property to Entity List.
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted information.
- Set the Prompt message property to a message that prompts the user to enter information that matches the entity list.
- Strict: No errors allowed.
- Medium: Tolerates up to one error in words of four characters or more.
- Loose: Tolerates up to two errors in words of four characters or more.
favoritePizza
Workflow variable. You can then use this variable in other parts of your Workflow to make decisions or take actions based on the user’s favorite pizza type.
For example, you could use this variable to direct the user to the pizza ordering process, or to suggest additional toppings based on their selection.
Advanced Configuration
Retries
The Retries setting helps the bot handle situations when it doesn’t understand what the user is saying. It allows the bot to ask the user to provide the information again in a different way. This can improve the user’s experience with the bot, increase engagement, and help the bot handle more conversations before giving up. Number of retries This is the maximum number of times the bot will ask the user to provide the information again before giving up and moving to the next card in the conversation or triggering the failure transition if enabled. Retry message This is the message that the bot will show to the user each time they fail to answer the question. It will ask the user to provide the information again in a different way. If the capture has predefined choices the retry message will contain the buttons again. You can also add variables to this message using the following syntax:Validation
The Validation setting allows you to verify that the user’s input meets certain criteria before proceeding with the conversation. This can help ensure that the information collected is accurate and relevant to the conversation. Properties 1. Label The label property allows you to generate validation code based on plain natural language instructions. This can make it easier to set up the validation rules without needing to write code. 2. Code If you prefer to write your own validation code, you can use the code property. This property allows you to write code to evaluate the user’s input and determine whether it meets the validation criteria. 3. Validation failed message If the user’s input fails validation, you can customise the message that the bot sends to inform the user of the validation failure. Steps to use Validation To use the validation feature, you can add the validation properties to the Capture Information card in the Botpress interface. You can choose to use the Label or Code property to set up the validation rules. Once the validation rules are set up, the user’s input will be evaluated before proceeding with the conversation. If the input meets the validation criteria, the conversation will continue normally. If the input fails validation, the bot will send a message with the validation failed message you have specified. Example 1: Suppose you have a Capture Information card that asks the user for their age. You want to ensure that the user enters a number between 18 and 100. You can use the following validation code in the Validation section of the card:true
. Otherwise, it returns false
.
Extract from History
The Extract from History setting allows the bot to extract values from previous messages in the conversation history. This can help the bot better understand the user’s input and provide more accurate responses. Property Number of messages from history to extract from This property determines how many messages in the conversation history the bot will try to extract the value from. A value of 0 means that the bot won’t look back in the conversation history and will only use the user’s most recent message. A value of 2 means that the bot will extract the value from the user’s previous two messages. Example: Let’s say you have a Capture Information card that asks the user for their favorite color. If the user has already mentioned their favorite color earlier in the conversation, you can use the Extract from History feature to extract the value from their previous message. If you set the Number of messages from history to extract from to 1, the bot will extract the value from the user’s previous message. If you set it to 2, the bot will extract the value from the message before that too. For example, if the user said My favorite color is blue earlier in the conversation and you set the Number of messages from history to extract from to 1, the bot will extract blue as the user’s favorite color without asking the user again. This can save time and improve the user experience by avoiding repetitive questions.Cancellation
The Cancellation setting can be used to break out of the conversation and cancel the Capture Information card. This can enhance the user’s experience with the bot, making the conversation feel more natural and increasing engagement. Properties User can cancel the capture With this option turned on, users can cancel the Capture Information card at any time during the conversation. Confirm before cancelling If you turn on this option, users will be asked to confirm whether they want to cancel the Capture Information card before it’s cancelled. Confirm cancel message This option allows you to customise the message that the bot sends to confirm the user’s decision to cancel the Capture Information card. Example 1: Suppose you have a Capture Information card that asks the user for their name and email address. If the user decides to cancel the conversation, the User can cancel the capture option will allow them to do so easily. Example 2: If you turn on the Confirm before cancelling option, the bot will ask the user if they’re sure they want to cancel the Capture Information card before it’s cancelled. If the user confirms the cancellation, the bot will send a message that you can customise using the Confirm cancel message option.Choices
The Choices setting is used to offer a list of options to the user as a response to a Capture Information card. This can be useful when you want to restrict the user’s input to a specific set of values or provide them with a list of options to choose from quickly. You could add fixed options or add variables to each choice to make them dynamic. You can also render the list of choices dynamically by toggling the SuperText input and adding an array variable with the following format:LimitIf you add more than 5 choices, they will be rendered as a Dropdown/List instead of buttons. This number may vary by channel.{’ ’} The choices labels shouldn’t be longer than 20 characters otherwise they will get cut in some channels.
NoteChoices are only available for Single Choice, Multiple Choice, Boolean, Confirmation and Raw InputCapture cards.
Advanced
- Add transition to handle failure
- Skip if variable is already filled
Prompt Chaining
Prompt Chaining allows you to extract multiple values from a single user message using multiple Capture Information cards in sequence. If a value wasn’t found, the respective Capture Information card will ask for its value. Chaining Multiple Prompts To chain multiple Capture Information cards together, you need to follow these steps:- Add the first Capture Information card to the Workflow.
- Set the Type property to the type of information you want to capture (e.g., Person Name).
- Set the Variable name property to the name of the Workflow variable you want to use to store the extracted information (e.g., Person Name).
- Set the Prompt message property to a message that prompts the user to enter the information (e.g., Please enter your full name).
- Set the Extract from history property to 1.
- Add the next Capture Information card to the Workflow.
- Repeat steps 1-6 for each additional Capture Information card you want to add, making sure to use a different variable name for each one.
{{workflow.variableName}}
.
Example
Let’s say you want to capture a user’s full name, email address, and phone number. You can create a new Workflow with the following steps:
- Add a Capture Information card to the Workflow with the following properties:
- Add a second Capture Information card to the Workflow with the following properties:
- Add a third Capture Information card to the Workflow with the following properties: