Triggers: Any Text
The Any Text trigger is a special case where you want Flow to respond to anything a user might say or send or collect free form data. This enables you to respond to broad input you cannot train the AI for.
Use cases are open input like asking a user about a complaint or finding a piece of data like an email address.
Entity type
By default the Any Text is of a Text type. Whenever a user sends or says something, it gets put inside a param you can specify the name for.
You can also limit the matches that are made to system or custom entity types.
Any Text supports the following types:
Type | Description | Example match |
---|---|---|
date | Will find and convert any date in natural language to a UTC date | Next Saturday |
time | Will find and convert any time in natural language to a UTC date | Around 12pm |
Number | Find and convert numbers | twenty five |
Finds an email address | My email is [email protected] | |
Phone number | Finds a valid phone number | that’s (055)1133211 |
URL | Finds a valid URL | my website is www.janedoocorp.com |
Distance | Finds a unit of distance | I think 2km |
Money | Finds a currency and ammonite | I have 20 EURO |
If the Any Text has a specific type, a match is only made if it can match the data.
This also enables you to branches, Any Text trigger with other Any Text or Unknown trigger
Params are lists
Data that is captured can be a list. Flow does not override any data but always appends it. The following is an example of a JSON representation of a captured param:
> {
> "phoneNumber": [{
> "value": "+1234567890",
> "match": "My number is 1234567890"
> }, {
> "value": "+9012345678",
> "match": "My landline is 9012345678"
> }]
> }
##
String templates
Extracted data can be used dynamically inside replies using string templates.
Filling user profile attributes
User profile attributes can be set using params by giving them a system-defined name.
The following profile data can be filled:
- user.name
- user.profile.fullName
- user.profile.firstName
- user.profile.lastName
- user.profile.gender (M/F/U)
- user.profile.locale
- user.profile.timezone (offset from UTC, -1)
- user.profile.email
- user.profile.picture (url)
Read more
Updated 11 months ago