Save as Draft
Within the Form.io renderer, you can enable a Save as Draft feature which will save a submission in “draft” mode either periodically (every 5 seconds), or manually, as the user is filling out the form. This system will also “restore” a draft submission if the user leaves the page, and then comes back in a later session. A common term used to describe this process is “save and return” capability.
This feature works along with our authentication system to attach a “draft” submission to a user who has been authenticated, to periodically store the draft of that submission as that user is using the form.
The Save as Draft feature requires authenticated users in order to relay the user back to the previous form state. This feature will not work with Anonymous users.
Setup
In order to enable this feature, you simply need to use the saveDraft
parameter when you are rendering the form.
This will then trigger the drafts to start periodically every 5 seconds once a user is established through the use of common Form.io authentication modules, such as the one provided within Angular.
Timing configuration
You can also configure how regularly the “save draft” is triggered using the saveDraftThrottle
parameter. This defaults to 5 seconds and is defined in milliseconds.
Manual Draft Submissions
You can also enable draft submissions to occur manually through the use of our Button component, configured with the Action of “Save State” and the “State” option configured as “draft”. Then when this button is pressed, it will save the submission in “draft” mode.
Last updated