Reset all the slot of the form when deactivate

Currently i’m handling the situation in which the user want to cancel an action or task (most likely a form action) with this story:

## ask about user location - cancel
* ask_user_location
    - user_location_form
    - form{"name": "user_location_form"}
* cancel OR done
    - action_deactivate_form
    - form{"name": null}
    - utter_cancel

It worked well, but any value that the user provided is still kept in its corresponding slot. Since most of my functions are about querying or finding information, it’d be weird if the user invokes other functions and the bot responds with the old information, in example:

User: I want to find the location of an employee
Bot: Please tell me the name of the employee whom you want to search for 
User: David
Bot: I find multiple employees named "David":
     - id 1: David A
     - id 2: David B
     - ....
Bot: Can you specify the id of the corresponding employee ?
User: cancel
Bot: The action is cancelled.
User: I want to find the department of an employee
Bot: I find multiple employees named "David""
       ....
      (As you can see, this can be a little confusing,
       the bot should ask for a name again).

Although this situation is not gonna happen often, and it also doesn’t affect much of the bot performance since the user still can provide another name or say something like “No i want to find department of Lucy” or something, i simply feel like it’s a little bit less smooth in term of conversation.

So i wonder if there is a way to get like a list of required slots of the current active form inside an action such as action_deactivate_form, so i can deactivate the form and set all its slots to None.

You can set the slot to none in the story with :

- slot{"name" : null}

@GuillaumeKoenigTncy Thank you for replying. Do the slots need to have auto_fill = true ? I tried this with my slots (auto_fill = false) and it didn’t seem to work.

If I remember good, autofill attribute is only used when the entity is detected by the NLU.

Where do you place it in the story ?

I placed the events like this:

## ask about user location - cancel
* ask_user_location
    - user_location_form
    - form{"name": "user_location_form"}
* cancel OR done
    - action_deactivate_form
    - form{"name": null}
    - slot{"name": null}
    - slot{"user_id": null}
    - utter_cancel