Cannot deactivate form

I want to enter a phone number or to type “Initial menu” (to go to the initial menu and exit from the phone number verification).

I added a regex for phone number verification and it works. (forms,slots,mapping are defined).

  • If the phone number input is correct: I will remember that your phone number is …

  • Else: Please reenter your phone number or type “Initial menu”.

However, when the input is “Initial menu”, i receive * Please reenter your phone number or type “Initial menu” again and again.

Any ideas what’s wrong?

story

1 Like

Can you move this steps in stories file to rules file?

I think you can do it just using rules and the story is the problem :stuck_out_tongue:

Hi @itsjhonny I thought that for handling Unexpected Input, stories is the right thing to do. Could you please elaborate why I should use a rule instead of a story if I want to exit a form?

I think you can’t combine rules with stories when using rasa Form. I have many issue doing it. I just chose one Rules or Stories

Maybe @ChrisRahme can explain it better for us, or someone with more experience than me :smiley:

But look this thread

Edit ---- I changed my mid, sorry for my mistake.

try it in your story

  - slot_was_set:
    - requested_slot: null
  - active_loop: null
  - action: utter_exit_form

reference: https://github.com/RasaHQ/rasa-2.x-form-examples/blob/main/04-asking/data/stories.yml

1 Like

As @eirini said, this is better done in stories than in rules (see example here with the stop intent).

But @itsjhonny, what do you mean by combining? If you’re talking about using rules and stories in the same “flow”, no you can’t do that, but you still can use both. :slight_smile:

The link above is a file for form stories, and here is a file for the forum rules.

You can see I’m using rules for activation and submission, and stories for deactivation and specific examples.

Is your bot correctly detecting the initial_menu intent? If yes and it is stopping at that intent, consider using interactive learning in Rasa Shell or Rasa X to correct that behavior and add the corrected stories in the file, as you can see in the stories files I linked.

1 Like

Thanks @ChrisRahme. This will help a lot :smiley: I think Rasa Form documentation a little confuse :joy:

1 Like

Agreed :slight_smile: But it’s not really because of the docs, it also needs practice, trial and error