Having forms being conditionally called from formaction:

Hi,

Currently what I have is a big form that based on certain conditions requests certain slots. For instance, if the user says he has smoked, we will ask what has he smoked and for how long. My question is would it be possible to do this by calling a form that would handle all smoking related slots, from the main form? I haven’t seen anyone try this so I am unsure.

Thanks.

@MaZe not sure if it is possible to call another FormAction from an active FormAction but conditionally (based on smoked = true/false) setting required fields in required_slots method will effectively give the same results (if i understand your problem statement correctly).

something like @staticmethod def required_slots(tracker): if(tracker.get_slot(“smoked”) is not None and tracker.get_slot(“smoked”)==True): requiredSlot = [“A”,“B”,“C”] else: requiredSlot = [“E”,“F”] return requiredSlot

2 Likes

I realize this is an old post, but your required_slots example really helped me out. Thanks!

2 Likes