Containers for storing and reusing information in Botpress Studio.
Type | Description |
---|---|
String | Values that are treated as text. Strings can contain any amount of letters, numbers, or special characters. Example uses: Storing a user’s name, storing an AI task’s generated message. |
Boolean | Variables can be true or false, with a lowercase ‘t’ or ‘f’. Example uses: Storing if a user is a returning customer, storing whether the bot has greeted the user or not |
Number | Variables that are numeric, either with or without decimal places. Example uses: Storing a user’s phone number, storing an address’s area code |
Date | Variables that are a single date or date and time. Botpress uses ISO 8601 date/time format, such as 20220921T10:34:14 for 21 September 2023 at 10:34 AM (with 14 seconds). Example uses: Storing when the user starts a chat, storing a user’s appointment date |
Object | Variable that is a collection of key-value pairs. Useful when dealing with code and written like {key: value} . Example uses: Storing a user’s profile, storing the results of an API call |
Array | Variable that is a collection of other, similar variables. Arrays can contain strings, like [“a”, “b”, “c”] , or Objects like [{key:value},{key:value}] . Example uses: Storing a user’s past messages, storing options for the user to choose from |
Enum | Variable that can be one of a set number of choices. Example uses: Storing days of the week, storing items available from a food menu |
Pattern | Variable that uses Regular Expressions/Regex to store a special pattern. This pattern can match certain words or numbers. Example uses: Storing account numbers, storing flight numbers |