The Submissions API allows you to create and manage the submissions made on a form.
With the Submissions API, you can:
- Query and manage a submission.
- Retrieve the total number of submissions per form.
- Confirm a submission or mark submissions as seen.
- Retrieve a media upload file URL to use in a submission for forms that include a field for uploading files.
When submitting a form:
- Call the
createSubmission()
function and pass the form field values of a particular form.
createSubmission()
forwards the form field values to the server.
- The server proceeds to validate the submission:
If the validation is successful:
createSubmission()
submits the form.
- Records the submission into the WixForms collection.
If the validation fails:
- The server throws an error, which is then passed to the API.
- The submission process is aborted.
It’s important to note the following points before starting to code:
- There are several apps that use forms:
- Wix Forms: site visitors can submit their contact information to send message to a company, or to subscribe to a newsletter.
- Wix Pricing Plans: forms can be used for online orders, site visitors can submit their contact info and address during the checkout.
- Wix Online Programs: forms can be used as quizzes.
- You must first have a form on your site in order to manage Submissions.
- To use the Submissions API, import
{ submissions }
from the wix-forms.v2
module.
- Submission: Data received when a form is submitted by a site visitor.
- Submissions Table: A table in the dashboard that records submissions to a form.
- Media Upload URL: A URL used to upload a file to a form.