Fallbacks

Fallback responses are used when a bot has to repeat the same question - for example when the user provided wrong answer or was silent

πŸ‘

See this example project you can import into your environment.

Fallback responses are used when a bot has to repeat the same question - for example when the user provided wrong answer or was silent. To make those repetitions more user-friendly and human-like, conversational UI requires that they are not identical to the first asked question.

For example:

Bad πŸ˜’Good 😊
Bot: β€œPlease say your PIN code.”Bot: β€œPlease say your PIN code.”
Human: β€œ123”Human: β€œ123”
Bot: β€œPlease say your PIN code.”Bot: β€œYour PIN code should have 4 digits. Please try again.”
Human: β€œ1234”Human: β€œ1234”
Bot: β€œPlease say your PIN code.”Bot: β€œThe PIN code you provided is not correct. Please try again.”

No customizable fallbacks: Say and Ask blocks

By default, if we use Request User Input in blocks such as Say or Askand there is no output that fulfils given conditions, the bot will repeat his response in an identical way. This is why this is generally considered a bad practice to use these blocks together withRequest User Input outside of the most basic demo bots. The only exception is when the responses (and fallback responses) are generated from Knowledge Base.

So, to customize fallback responses, we can use one of the following methods:

Basic method: Say with fallbacks block

This method uses a dedicated Say with fallbacks block to handle fallback responses. When the conditions given in any of the outputs are not fulfilled and the bot can’t continue with the conversation, the bot will repeat the question using fallbacks responses provided in the block setup.

🟩 When to use: for simple conditions that can be resolved using only Say with fallbacks block outputs.

πŸŸ₯ When not to use: for complex or multiple conditions that are resolved in the blocks coming after Say with fallbacks block.

Fallback responses πŸ‘‰ 1. Basic method

Fallback responses πŸ‘‰ 1. Basic method

Say with fallbacks setup πŸ“·

Say with fallbacks setup πŸ“·

Say with fallbacks outputs πŸ“·

Say with fallbacks outputs πŸ“·

Saving intents & variables to Memory

Unlike Ask block, Say with fallbacksblocks doesn’t automatically saves anything to Memory, so we have to do it in the next Custom block using Memory input fields.

πŸ“˜

Learn more about Say with fallbacks block here

Fully customizable method: Say conditional block

There are situations where Say with fallbacksis not enough because the block in which you request user input is not the same where you are able to resolve a condition.

For example, when you ask for a birthdate during authorization process, you will know if you need a fallback only after you use Integration block to verify a user via API.

Another example is when you want to use Custom block to use more complex Expression language or JavaScript to check a user input for condition.

Fallback_responses πŸ‘‰ 2. Fully customizable method

Fallback_responses πŸ‘‰ 2. Fully customizable method

Adding multiple fallbacks to the same question

To add multiple fallbacks, you need to create a small loop using Custom blocks, like on the screen above. This example checks if the date provided by the user is a Saturday. It uses Say conditional dependant on a loop to add mutliple fallback replies.

πŸ’‘

Alternative

Use Save date to Memory block instead of Reset fallback block to set memory.fallback to 0. Thanks to that, you can delete Reset fallback block.