Ask a Question
Many bots will want to collect more info from the user before they can do something useful. Our Ask a Question action allows you to do this easily and intelligently.
By stringing multiple questions together, as separate actions one after the other, you can ask a series of questions too.
Settings & Outputs
You'll need to set up these inputs:
- Response Path - this tells Flow XO where to route the message (it's normally the response path output from the trigger).
- Question Type - choose what type of question this is. You can find a description of each type below.
- Question - the text you'd like to use to prompt the user. You can choose to 'add a variation' to create several versions of the prompt text. One of the variations will be chosen at random, making the conversation feel more natural if it's a question that's asked often.
- Choices - only if you choose the choice question type. Provide the choices that you'll offer to the user. If the underlying value will be different to the name of the choice, you can define that too. Otherwise, the choice itself will be used as the value.
- Allow Unknown Response - setting this to Yes allows the flow to continue even if the user types a response that is not provided as one of the choices. Use this if you want to provide some useful default answers, but also want the user to be able to supply their own custom response.
- Validation - only if you choose the text question type. Either choose from the available predefined validation formats (more details below), or select Regex to provide a regular expression.
- Custom Validation Message (only shown if a validation type is chosen) - leave this field blank to use the default validation message, or add your own message to customize it.
- Number of Invalid Answers (only shown if a validation type is chosen) - specify how many incorrect answers the user can provide before the question is abandoned.
- Expire After - the question will expire after this amount of time, or the user has exhausted all retry attempts.
- Notify on Timed Expiry - sends a message if the question expires automatically (after the amount of time selected in Expire After).
- Custom Expiry Message - leave this field blank to use the default expiry message, or add your own message to customize it.
- Send Reminder - send a message half way through the expiry time (or after 15 minutes if no expiry) to remind the user to answer the question.
- Custom Reminder Message (only shown if you choose to send a reminder) - leave this field blank to use the default reminder message, or add your own message to customize it.
- Skip Question - if you tick this option, we'll tell the user they can write "skip" (or similar words) to skip the question. If they do this, the answer output will be empty. When "Skip Question" is set to Yes, questions that fail validation or time out will automatically be skipped, instead of causing the conversation to become "Abandoned"
Here are the outputs you'll be able to use:
- Date & Time - the date and time that the answer was received.
- Answer - either the text that the user typed in or the name/value of their choice.
- Choice - if this is a choice type question, this output will contain the choice itself (as opposed to the value, if one is defined). It will always be empty for none-choice questions.
You can choose from 2 question types:
- Text - the next message in the same channel is accepted as the answer (after validation, if enabled).
- Choice - the user is told what the options are and asked to make a choice. We'll show a set of buttons if the platform supports it. The next answer must be a case insensitive match to one of the choices (or a click of a button). If the user's response isn't recognised, the question will be asked again until a recognised choice has been made.
By choosing a validation, you can be sure that an answer will only be accepted if a known data type can be parsed from the user's response. The answer will also be standardized.
The available validations are:
- Email Address
- Decimal (10,00 - comma decimal mark)
- Decimal (10.00 - dot decimal mark)
- Date (mm/dd - American date format)
- Date & Time (mm/dd - American date format)
- Date (dd/mm - European date format)
- Date & Time (dd/mm - European date format)
Validations will produce the following standard formats:
- Decimal (10,00):
- Decimal (10.00):
- Date & Time:
The 'Date' and 'Date & Time' validations work with natural language expressions such as "tomorrow" or "friday at 10am". Our guide to Date & Time Handling has more details about what formats are understood.
Dates and times are processed and output in the timezone set at the account level, except where a timezone offset is provided as part of the date (for example, -05:00 or +0100).
If the user provides other words around the answer, we'll try to parse the answer itself from the response. For example, email will accept "my email is firstname.lastname@example.org" and output "email@example.com" as the answer.
When the user doesn't provide a valid answer
Ask a Question steps can cause a conversation to be cancelled, or "Abandoned". This will happen if the timeout period elapses without the user providing an answer, or when the number of validation attempts is exceeded and the user doesn't provide a response that satisfies the validation criteria, or example providing a proper date. Although this is default behavior, and assumes that each question is critical to the overall flow, you have a variety of options to manage how Flow XO reacts to a user failing to provide a valid answer in within the pre-defined timeout period:
1. Set the "Skip Question" property to True under the "Custom Expiry" settings. This will cause a timed our or invalid answer to be skipped, and the flow will continue without an answer to the question being provided.
2. Trigger a specific flow whenever a conversation is abandoned.
Using the Flow-XO Utilities integration, you can create a special flow that runs any time a conversation is abandoned because of:
- The user providing too many invalid responses
- The user not answering the question within the timeout period
- The user explicitly ending the flow by typing "bye" or "quit"
Please see this article for more details.
Let us know how we can improve Flow XO on our feedback site.