So, I have a FormAction asking for email address and a couple other slots, and when all are filled a custom action is executed. The first slot required is the email, and before any other slots are filled I run a validation against DB to check if user exists. If user exists, the email slot remains set and an additional VALID slot is filled as True. Then the form asks for the other things…
The problem is the following:
- Let’s say the email gets validated and filled and so the VALID slot is True. Then the bot starts asking for other slots,
- but the user for some reason enters a different email address as part of an intent E.g. “Can I do this with firstname.lastname@example.org too?”, Then the email entity is recognized and the email slot gets filled with a new value.
- Now this is not validated, but all other slots are already filled, or maybe the bot asks for one more and then the formaction is carried out.
- This is a problem because the email is overwritten without the bot validating anything and the formaction is carried out with a wrong user or returns an error.
Therefore I would appreciate some help:
- Can I add somewhere that if the email slot is already filled, then it shouldn’t be filled again? If yes, where should I overwrite the FormAction class?
- Or maybe can I say that if a slot is already different than None, then it cannot be reset to anything but None?
- Any other ideas?
The following 2 topics are similar but not identical:
Hope this is clear, any ideas are appreciated.