# Asking for answer confirmation everytime an user answer in a certain way inside a form

**URL:** <https://forum.rasa.com/t/asking-for-answer-confirmation-everytime-an-user-answer-in-a-certain-way-inside-a-form/50922>\
**Category:** Rasa Open Source\
**Created:** [January 27, 2022, 9:15am UTC](https://forum.rasa.com/t/asking-for-answer-confirmation-everytime-an-user-answer-in-a-certain-way-inside-a-form/50922 "2022-01-27T09:15:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fra98](https://avatars.discourse-cdn.com/v4/letter/f/43a26b/32.png) [@fra98](https://forum.rasa.com/u/fra98)\
**Post date:** [January 27, 2022, 9:15am UTC](https://forum.rasa.com/t/asking-for-answer-confirmation-everytime-an-user-answer-in-a-certain-way-inside-a-form/50922/1 "2022-01-27T09:15:22Z")

</div>

Hi everyone, I have a long form asking for several informations to an user, each slot is validated manually by a custom action. I want to add a confirmation everytime an user answer is near the correct answer. Example: Bot asks user in which season are we:

- If user answers “Spring” → Bot should answer “Are you sure?” → If user answers yes then the slot is filled, is user says no than the question is repeated
- if user answers with the correct season (Winter for example) than the bot just fills the slot without asking confirmation
- if the intent is not recognized as a possible answer, the entire question is re-asked.

I have no idea on how to introduce these “ask the user if his sure about the answer” in the middle of each slot validation. Running RASA2 btw.

---

<div class="post-metadata">

**Author:** ![fkoerner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fkoerner/32/11784_2.png) [@fkoerner](https://forum.rasa.com/u/fkoerner)\
**Post date:** [February 9, 2022, 8:31am UTC](https://forum.rasa.com/t/asking-for-answer-confirmation-everytime-an-user-answer-in-a-certain-way-inside-a-form/50922/2 "2022-02-09T08:31:57Z")

</div>

I can sketch out a way to do this, but you’ll need to implement it 🙂

You can use the [slot validation action](https://rasa.com/docs/rasa/forms/#validating-form-input) for that particular slot to achieve this. You’ll need to implement the logic you describe within that action.

If the user gives the wrong answer, you set a `needs_confirmation` slot, and add a `confirmation` slot to the required slots (more on that [here](https://rasa.com/docs/rasa/forms/#dynamic-form-behavior)). You can set the `needs_confirmation` slot to the slot name that needs to be confirmed, and None when all slots are filled correctly. Then you’ll also need a response defined for the `confirmation` slot in your domain, something like:

```auto
utter_ask_confirmation: 
    - text: "Are you sure?"

```

In the validation action for the `confirmation` slot, you can either leave the slot that needed confirmation be (if the user affirmed), or reset it (if they denied). Note that when you reset the slot, the assistant will ask to fill that same slot again by default.

Then, you’ll also need to do some cleanup:

- reset the `needs_confirmation` slot
- remove the `confirmation` slot out of the required slots again
- reset the `confirmation` slot for next time

Hope that helps, feel free to ask a followup if you get stuck!
