How to store Form state

How can i store Form state so that I can resume it after some time.

suppose my Form has 10 slots to be filled, after 7th slot user wants to check something else and asked for it. my chatbot should be able to store the Form state (7 slots filled value), once going back to the form it should ask from 8th slot

Hi @omkarcpatil

This is in fact the default, unless you modify the slots somehow while the form is interrupted. When you start the form (at any point in the dialogue), it will only try to gather the information that hasn’t been filled yet.

@j.mosig, yes but what if i have to make all of them None before going to next form as new form may exist same slots to be filled

@omkarcpatil

If you cannot avoid changing / resetting the slots after the form, then you could write two custom actions: one which stores the current slots and one which later overwrites the slots with what was stored. The former would be called on form submission and the latter at the beginning of the new form. You can create this behavior with rules.

The storage itself has to be a slot, too. If the slot-type is any, you can store all kinds of data in there, such as a dict of all the other slots.