Rasa 3.1 I have a form named “order_form” with name, email, contact, and address slots. The form works properly. Then I have a form validation class in actios.py file named OrderFormValidation(FormValidationAction) who’s name() returns “validate_order_form”. Then I have methods for validating each slots like validate_name, validate_email, etc. I have listed validate_order_form in “actions:” in the domain.yml file as well. I run the rasa open source and action server in --debug mode. I start conversation with the system, everything goes as expected. The custom actions in actions.oy file also works. But, the validation is not triggered. What could be the possible reason? Or how can I debug this error?
Can you send me the action.py code for your form? so that it’s easy to understand what you have missed in it
Hello, I am also having a same issue with that I am Importing many things but not making any difference in output. Also checked this reference. Everything looks the same. Even I am not getting any output on action server.
Hello, I am also having a same type of issue. Need Help.
Here is the sample code from action.py class ValidateOrderForm(FormValidationAction): def name(self) → Text: return “validate_order_form”
def validate_contact(
self,
slot_value: Any,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: DomainDict,
) -> Dict[Text, Any]:
"""Validate `contact` value."""
# clean phone/mobile number from spaces and special characters
contact: str = clean_contact(slot_value)
# contact numbers between 8 and 12 are allowed
if len(contact) < 8 or len(contact) > 14:
dispatcher.utter_message(text="Please give a proper contact number")
return {"contact": None}
return {"contact": contact}
There are other methods in this class but don’t include it for the sake of simpicity. The problem is that validation is not triggering.
Have you imported the clean_contact function in action.py?
and try to get the slot value from tracker with this command
tracker.get_slot(“contact”)
then try to validate with the condition
The problem is that validation actions are not triggered. Even If I don’t import clean_contact and form is triggered, it will give me an error.
Did you add validate_order_form
to the actions
section of the domain.yml
? I had the same problem and simply fogot to add the action there.
@soerenetler It is clearly mentioned in the question that it is already added.
I have the same problem too. added print statements to check, it turns out that the form validation’s name function is being triggered, but not other methods
Was this sorted as I am facing the same problem
Hi Did you find any solution to this problem? I’m facing the same situation and i don’t find any solution in doku
Hi Did you find any solution to this problem? I’m facing the same situation and i don’t find any solution in doku