Rasa 2.0 - How to deactivate a form during validation?

@Ghostvv It’s not working for me too. if anybody has created an issue please share a link here. or will create an issue and share the link of that issue here

I have the same issue as well … action_deactivate_loop is not working for me either

I did try to deactivate form and it worked with return {“requested_slot”:None} inside validate_slot_name with:
rasa version 2.1.2
sdk version 2.3.1
python version: 3.7.5

Hi Dishant… Can provide details here.it will be helpful.

Let’s say you have confirm slot to be validated, where when you say yes it deactivates form

validate_confirm(...):
  if "no" in value:
     return {"requested_slot": None}

That’s what I have explained above but just provided return statement since validate function differs for everyone.
Feel free to ask anything you have in mind.

1 Like

thank you

1 Like

Hey, return {“requested_slot”:None} was working and the form was deactivated as intended for me but currently the form continues to ask for slots even after returning None. I guess maybe I messed up with the stories. Can you provide any example story/rule, so that I can try it out. Also are there any other reasons for this behavior?

The story you need is just same as rule:

steps:
- intent: form_start
- action: start_form
- active_loop: start_form

rule to deactivate form

- rule: Deactivate contact us form
  condition:
  - active_loop: contact_us_form
  steps:
  - action: contact_us_form
  - active_loop: null
  - slot_was_set:
    - requested_slot: null
  - action: action_submit_contact_us_form

For DEvelopers who want to deactivate form from action_ask_slotname

def action_ask_slotname(para1,para2,...):
     <your code>
    return [SlotSet('requested_slot',None)]
1 Like