Use Rasa Forms with different responses for yes/no answers

Hi all!

I am learning how to use Forms. All my required_slots are of type: bool so I am using slot mappings type: from_intent, value: true or value: false.

However, if value:false it means user is having trouble, and so I should provide a different response instead of keeping with the form… how can I implement this?

See example of slot in forms below:

- first_form:
    - required_slots:        
       - proceed:
          - type: from_intent
          value: true
          intent: affirm 
          - type: from_intent
          value: false
          intent: 
            - deny
            - issue

So, if user replies “no” or “I am having trouble”, I dont want to ask the next question of Form, but instead: help the user solving the problem, and then return to next question of Form… any better way than just defining different stories?

Hello, you can look at Dynamic Form Behavior to ask for the next slot using the previous slot’s value.

See this example (line 655).

@ChrisRahme thanks for suggesting! I am a bit confused with with the example you showed: in the sequence of if/else there are checkpoint = True, checkpoint = False. Is this the same as using checkpoints in stories.yml?

Is this the correct approach to check next slot based on the previous one?

No no, this is just a variable in the code, nothing to do with story checkpoints :slight_smile:

This code just shows that you can do “if Slot X is True, ask for Slot Y, otherwise Slot Z”.