How to ignore re-asking the slot if validation fail?

Hi,

I have a slot that loan_type and also have FormValidation. Here check with DB and return slot_value if form success or return utterance utter_no_result if the form fails and here if form validation fails it should ignore re-asking the slot and utter another utterance after the utter_no_result

class ValidateLoanForm(FormValidationAction):

    def name(self) -> Text:
        return "validate_loan_form"
    
    def validate_loan_type(
    self,
    slot_value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) ->Dict[Text, Any]:
        
        print("validate", slot_value)
        if slot_value and slot_value.lower() in list(loan_db().keys()):
            return {"loan_type": slot_value}                
        
        dispatcher.utter_message(template = "utter_no_result")
        dispatcher.utter_message(template = "utter_goodbye")
        return {"loan_type": None}

@manoj_kumar Try this:

class ValidateLoanForm(FormValidationAction):
 def name(self) -> Text:
        return "validate_loan_form"
    
    def validate_loan_type(
    self,
    slot_value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: DomainDict,
) ->Dict[Text, Any]:
        
        print("validate", slot_value)
        if slot_value and slot_value.lower() in list(loan_db().keys()):
            dispatcher.utter_message(template = "utter_no_result")
            return {"loan_type": slot_value}                
        else:
            dispatcher.utter_message(template = "utter_goodbye")
            return {"loan_type": None}

Do check are you able to fetch the slot value from loan_db while using print statement or even you can use rasa interactive.

yes! I am able to fetch the values from loan_db. But this code didn’t work.

requirement:
If the slot value in loan_db (if validation success) it should return the slot value return {"loan_type": slot_value} and if the slot value not in list(loan_db().keys()) (if the validation fail) the bot should say utter_no_result and utter_goodbye and bot should avoid asking to fill the slot again i.e., it should avoid utter_ask_{slot}.

@manoj_kumar Can you please see this basic process first and check its working in your use case or not, just check Validation form input : Forms

I have gone through the basic and implemented according to it only.