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.