I want to go back to previous menu in my rasa story using button but I don’t know how
Buttons have payloads representing intents. Write a rule saying when that intents get detected, do a certain action (show the menu).
can you please help me with the action the current action I wrote calls the same menu options again but not the previous one and I need to write go back for each step in my rasa story so that the user can keep going back
Let’s say what brings out the second menu is the intent menu_two
.
As a response to menu_two
, the bot will do action_two
. You link the intent menu_two
to the response action_two
using rules.
Whether it is a custom action or a response, action_two
should have a button to go back with payload /menu_two
. So, according to the rule, menu_two
will get detected and action_two
will be executed again.
I know this what I was asking is that can we go back to each step in a story like the way we move forward in a story
No need to create a new story just for it. It could even confuse the model.
Just one rule that says "when you detect intent menu_two
, execute action_two
".
So, when the back button is pressed, it will trigger menu_two
which will in turn trigger action_two
thanks to that rule.
No no you don’t understand what I am saying. With thing I can go back to menu_two only and not menu_one and menu_three…like a go back button for each step
Yes, I understood. You’ll need to do that for every button/menu.
For each button, you put as payload the intent that leads to it.
but then the back button will be different for each step… won’t that become messy
Not really, I don’t think so. I’ve done messier things haha
You just create a intent “back” and when send it as the payload of the button. When that button is clicked you delete the actions and last intent detected in the tracker. After that execute last action