In story condition statement not working

Hi , I implemented sample rasa chatbot application,I implemented form. When I write steps in sotry, In submit button I have written below code.

  • story: submit form

    condition:

    • active_loop: health_form

    steps:

    Form is deactivated

    • action: health_form

    • active_loop: null

    • slot_was_set:

      • requested_slot: null

getting below error: “YamlValidationException: Failed to validate ‘data\stories.yml’. Please make sure the file is correct and all mandatory parameters are specified. Here are the errors found during validation: in data\stories.yml:80: Key ‘condition’ was not defined. Path: ‘/stories/9’”

But above piece of code worked in rules.yml insted of story i replaced with rule.

Please help me to sort out this isseu.

Regards, subbu.

Hi Subbu - currently stories can’t have conditions. Training should work if you remove that condition.

Is there a use case you had in mind for using stories with this form rather than rules? Forms are built on top of the rules policy with Rasa 2.x, so you should submit the form in a rule. A story for this form would be built to help you cover unhappy paths, like chitchat interjections.

Hi @desmarchris, In my case ,I have to implement provide form information first next flow will go. examaple:

username email phonenumber these are form fields. after form filling buttons will display Male and Female. after click on any one of thesse, gender related info I have to show.

Can you please help me how to handle this using rules for form and how can I write story? Please provide sample code snippet.

thanks. subbu.

to play that back, you want to collect a few fields, then after that form is submitted, present another slot to fill (male or female) that will change what the answer looks like. Is this right?

Why not just make the last question part of the form as well? You’ll then need to make the gender field featurized so that you can provide different responses based on the result. Let me know if this is what you’re trying to do, and I can help with the rule.

@desmarchris , i think this is what i am looking for , please do help with the rules . Because i tried the same , create a form on the basis of last intent in the form i try to utter with different responses but it is just responding with the fallback action

@Panka_Patidar can you post the rules you currently have for this form?

Thanks a lot ! @desmarchris but its older version of rasa , rasa 1.10.0 which i am using , so i will share the story and the repsonses.

Stories
### interactive_story_10
* Our_Services_Main_Menu_02
- our_service_list_data_capture
- form{"name": "our_service_list_data_capture"}
* form: Wellness_and_Detox_inner_service_button_01
- form: our_service_list_data_capture
- form{"name": null}
- action_save_detail_our_service_list_data_capture
- Wellness_and_Detox_inner_service_message_01_service_list_data_capture
- form{"name": "Wellness_and_Detox_inner_service_message_01_service_list_data_capture"}
- form{"name": "null"}

## interactive_story_20
* Our_Services_Main_Menu_02
- our_service_list_data_capture
- form{"name": "our_service_list_data_capture"}
* form: Pregnancy_and_Babycare_inner_service_button_02
- form: our_service_list_data_capture
- form{"name": null}
- action_save_detail_our_service_list_data_capture
- Pregnancy_and_Babycare_inner_service_message_02_service_list_data_capture
- form{"name": "Pregnancy_and_Babycare_inner_service_message_02_service_list_data_capture"}
- form{"name": "null"}

## interactive_story_30
* Our_Services_Main_Menu_02
- our_service_list_data_capture
- form{"name": "our_service_list_data_capture"}
* form: Destress_Therapy_inner_service_button_03
- form: our_service_list_data_capture
- form{"name": null}
- action_save_detail_our_service_list_data_capture
- Destress_Therapy_inner_service_message_03_service_list_data_capture
- form{"name": "Destress_Therapy_inner_service_message_03_service_list_data_capture"}
- form{"name": "null"}

## interactive_story_40
* Our_Services_Main_Menu_02
- our_service_list_data_capture
- form{"name": "our_service_list_data_capture"}
* form: Skincare_Programs_inner_service_button_04
- form: our_service_list_data_capture
- form{"name": null}
- action_save_detail_our_service_list_data_capture
- Skincare_Programs_inner_service_message_04_service_list_data_capture
- form{"name": "Skincare_Programs_inner_service_message_04_service_list_data_capture"}
- form{"name": "null"}

Responses

 utter_ask_our_service_message:
- buttons:
- payload: /Wellness_and_Detox_inner_service_button_01{"our_service_message":"Wellness
    and Detox"}
  title: Wellness and Detox
- payload:/Pregnancy_and_Babycare_inner_service_button_02{"our_service_message":"Pregnancy
    and Babycare"}
  title: Pregnancy and Babycare
- payload: /De-stress_Therapy_inner_service_button_03{"our_service_message":"De-stress
    Therapy"}
  title: De-stress Therapy
- payload: /Skincare_Programs_inner_service_button_04{"our_service_message":"Skincare
    Programs"}
  title: Skincare Programs
text: Which service would you like to book?


utter_ask_Wellness_and_Detox_inner_service_message_01:
- buttons:
- payload: /Wellness_and_Detox_Our_Services
  title: Wellness and Detox
- payload: /Nasyam_Therapy_Our_Services
  title: Nasyam
- payload: /Kativasthi_Our_Services
  title: Kativasthi
- payload: /Elakizhi_Our_Services
  title: Elakizhi
- payload: /Netra_Tarpanam_Our_Services
  title: Netra Tarpanam
- payload: /Janu_Vasti_Our_Services
  title: Janu Vasti
text: Please select your Preference!

utter_ask_Skincare_Programs_inner_service_message_04:
- buttons:
- payload: /Skincare_Programs_Our_Services
  title: Skincare Programs
- payload: /Njavara_Kizhi_Our_Services
  title: Njavara Kizhi
- payload: /Udwarthanam_Our_Services
  title: Udwarthanam
- payload: /Takradhara_Our_Services
  title: Takradhara
- payload: /Lepam_Our_Services
  title: Lepam
text: Please select your Preference!

utter_ask_Pregnancy_and_Babycare_inner_service_message_02:
- buttons:
- payload: /Pregnancy_and_Babycare_Our_Services
  title: Complete Care
text: Please select your Preference!

utter_ask_Destress_Therapy_inner_service_message_03:
- buttons:
- payload: /Destress_Therapy_Our_Services
  title: Destress_Therapy
- payload: /Shirodhara_Our_Services
  title: Shirodhara
- payload: /Abhyangam_Our_Services
  title: Abhyangam
- payload: /Foot_Massage_and_Reflexology_Our_Services
  title: Foot Massage and Reflexology
- payload: /Pizhichil_Our_Services
  title: Pizhichil
- payload: /Naranga_Kizhi_Our_Services
  title: Naranga Kizhi
- payload: /Lymphatic_Massage_Our_Services
  title: Lymphatic Massage
text: Please select your Preference!