In part 1, we created a free entity "message", which can be used to store the message(any random text e.g. Happy birthday John), to be written on the cake.
Step 1. Add the requirement "message" in the skill.
After adding the requirement, we have to tell the chatbot how to handle a scenario when any of these inputs are not given by the user. For that, we define a reply which chatbot sends to the user in case a particular requirement is missing.
To achieve this, click on the Chevron of the Message row:
You will see two options.
If #message is complete.
If #message is missing.
Click on the +New reply on if #message is missing.
Select send message and select text message. Add a message of your choice.
After adding the message, we will now set a field in memory, basically a boolean flag so that chatbot knows we are trying to enter a message for cake.
We are doing this because if we enter any random input in the chatbot for which an intent is not defined, then the fallback skill is triggered. And since we do not know what message a user might want to get on the cake, we do not have a scope for the message entity. Hence we set a flag when the user is asked to enter the message for cake and check the value of this flag in the fallback skill.
So we set the following value for a variable cake_message_set.
The reply will finally look like this:
Step 2: Configure the fallback skill.
Open the fallback skill and navigate to the Actions tab.
Here, we will add a new message group.
This message group will get triggered when the cake_message_set flag is set to true.
If _memory.cake_message_set.flag is true
We can now take the text entered by the user as the message to be written on the cake and set it in the memory. We then unset the cake_message_set flag.
To do this, click the button Update Conversation, from the drop-down, select Edit Memory.
The following fragment appears:
In the Set memory field section, enter the memory key as message with the following value: