Reusing forms

Hi, I want to know if I can reuse a form. My requirement is that I need to collect same set of information from two different intents. So my two story paths are like:

story path 1: 
steps: 
- intent: intent_1
- action: form_1
- active_loop: form_1
- active_loop: null 
- action: action_1

story path 2: 
steps: 
- intent: intent_2
- action: form_1
- active_loop: form_1
- active_loop: null
- action: action_2

and my form definition is as follows:

form_1:
required_slots:
- slot_1:
      - type: from_entity
      - entity: entity_1
      - intent: intent_1
      - type: from_entity
      - entity: entity_1
      - intent: intent_2
- slot_2:
      - type: from_entity
      - entity: entity_2
      - intent: intent_1
      - type: from_entity
      - entity: entity_2
      - intent: intent_2

what I observe is that the form works as expected when intent_1 is provided. But when intent_2 is provided along with all the required slots (entity_1, entity_2) the bot still enters into the form and tries to ask the user for the slots. Any idea what is going wrong?

p.s: max_history is set to 4

@souvikg10 any idea?

@stephens would also like to hear your thoughts!

Take a look at the helpdesk bot. For example:

  - rule: start open incident form
    steps:
    - or:
      - intent: open_incident
      - intent: password_reset
      - intent: problem_email
    - action: open_incident_form
    - active_loop: open_incident_form

You should also read the forms docs and note example rules/stories for entering and completing the form.

Run rasa shell --debug and you can watch what is happening with your slots.

Yes @stephens for intent_1 the form is working perfectly fine - if I provide all the required entities the form is just validated and moves to the action_1 part. But in intent_2 the form doesn’t - if I provide all the required entities it still asks for the same details and once I provide that it exits with action_2.

The example you have provided will have only one end action right? For me the only the forms step is similar between the two stories. Based on the intent the action also changes, just the middle step (forms) is same

You need to read the forms docs I linked to above.

Yes @stephens I had a look at that. I did mention intent_2 under forms intent field. Still the same problem