Euler
(Euler Randi Coelho)
February 2, 2022, 7:43pm
1
I’ve tried in some ways but without success.
I need that after filling the slot “slot_continue” with the true value, the form would request the slot “slot_field” again
or if the “slot_continue” slot is set to false would perform a custom action.
Can anyone help me?
ChrisRahme
(Chris Rahmé)
February 2, 2022, 7:48pm
2
Can you please show what you have tried to be able to assess your level and/or if you were close to the solution?
You’ll be able to do that by implementing the required_slots() method for this form, in which you basically do this logic:
async def required_slots(self, domain_slots, dispatcher, tracker, domain):
additional_slots = []
if tracker.slots.get('slot_continue') is True:
additional_slots.append('slot_field')
return additional_slots + domain_slots
Euler
(Euler Randi Coelho)
February 2, 2022, 8:25pm
3
I created the form validation action, but it was not triggered.
ChrisRahme
(Chris Rahmé)
February 2, 2022, 8:39pm
4
If you do print('>>> I am here <<<')
at the start of the required_slots()
method, does it appear in the action logs when the form gets triggered?
ChrisRahme
(Chris Rahmé)
February 2, 2022, 8:53pm
6
Can you give more details?
What is happening? Is the form running but not the action, or the form isn’t even running?
I should know before continuing to the next step (you have to implement the validate()
method as well).
Euler
(Euler Randi Coelho)
February 2, 2022, 8:56pm
7
the form opens, receives values from all fields and closes at the end without going through the validation class.
no stories
Euler
(Euler Randi Coelho)
February 3, 2022, 2:55pm
8
@ChrisRahme , I managed to intercept the events.
Now during a slot validation. I need to abort (close) the form. Do you know how I can do this?
ChrisRahme
(Chris Rahmé)
February 3, 2022, 2:59pm
9
You can set the required_slot
to None
or return an empty list in the required_slots()
method