I have a number of forms and would like to be able to cancel by saying “cancel”. I have tried a rule as below but it just keeps going back into the form. There is an example of doing this with a story but I really don’t want to create cancel stories for each form and each field in the form.
This is the rule I have tried along with numerous variations.
Or, a method similar to the one Rodrigo mentioned above, you can use a FormValidationAction to return an empty list in the required_slot() method if the intent is ‘cancel’`:
def required_slots(self, dom_slots, dispatcher, tracker, domain):
if tracker.latest_message['intent'] == 'cancel':
return []
else:
return dom_slots # Or whatever your original required_slot() did
Thanks. The python solution is better as it could apply to all forms with a few lines of code rather than setting up stories for each form. However using “required_slots” it still continues to validate and submit.
Found solution below seems to work but perhaps there is a cleaner answer: