onSubmissionCreated( )


Triggered when a submission is created.

Method Declaration
Copy
function wixForms_onSubmissionCreated(event: SubmissionCreated): void;
Method Parameters
eventSubmissionCreated

Information about the created submission and metadata for the event.

An event that triggers when submission is created
JavaScript
// Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixForms_onSubmissionCreated(event) { const entityId = event.entity._id; console.log(`Created submission with the id: ${entityId}. Event details: `, event) } /* Full event object: { "entity": { "formId": "21bcb6c7-02b3-4ed1-b6db-7856094fac03", "namespace": "wix.form_app.form", "status": "PENDING", "submissions": { "first_name": "Patsy", "last_name": "McBride" }, "revision": "1", "owner": { "applicationId": "151e476a-715e-ec33-db9a-a7ff4d51f70a" }, "submitter": { "applicationId": "151e476a-715e-ec33-db9a-a7ff4d51f70a" }, "seen": false, "_id": "f8281b62-1b2f-45bf-ba7d-f041d7653d2d", "_createdDate": "2023-12-28T12:55:55.630Z", "_updatedDate": "2023-12-28T12:55:55.746Z" }, "metadata": { "entityId": "f8281b62-1b2f-45bf-ba7d-f041d7653d2d", "eventTime": "2023-12-28T12:55:55.630Z", "id": "a92d9e8b-abd7-4903-a954-5a6848f6f4eb", "triggeredByAnonymizeRequest": false } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?