What is the order of execution of validate_{slot_name} functions in FormAction feature?

Hi All,

Is there any order that validate_slot functions in FormAction class are executing. If yes then in which order are they executing exactly ??

if we have slot x,y then validate_x will get called or validate_y. Which one will get called first and second??

Or can we have common validate function so that we can check for all slots at once.

order is defined by your required_slots method

thank you so much @Ghostvv. :blush:

Hi @Ghostvv,

I have a situation where rasa plainly skips the validation of a slot and wonder why that is.

let’s say I have 3 slots - x, y, z. The order in ‘required_slots’ is correspondingly x, y, z . If I type something like ‘start my form action with x, y, z’, rasa skips the validation of x (actually fills the slot x without validating) and proceeds to y and because y’s validation is logically dependent on the value x gets assigned during its own validation, I end up with a bug. Evidently, I can force call x’s validation from within y’s validation but this is neither an elegant nor a reliable solution. I wonder what I can do to control the validation flow.

depending on what version you’re using, there was a bug with validating first input that is fixed in 2.0 alpha version. You can copy this function from master branch to your custom form action: rasa-sdk/forms.py at 71ba1dbe651fd5016c1742f0a559865a6b79bcd4 · RasaHQ/rasa-sdk · GitHub substituting active_loop with active_form