deleteSubmission( )


Deletes a submission.

This function moves the form submission into the trash bin. To delete the submission permanently, change the default permanent field value to true.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Submissions
Learn more about app permissions.
Method Declaration
Copy
function deleteSubmission(
  submissionId: string,
  options: DeleteSubmissionOptions,
): Promise<void>;
Method Parameters
submissionIdstringRequired

ID of the submission to delete.


optionsDeleteSubmissionOptions

Optional fields.

JavaScript
import { submissions } from "wix-forms.v2"; /* Sample submissionId value: "f8281b62-1b2f-45bf-ba7d-f041d7653d2d" */ export async function myDeleteSubmissionFunction(submissionId) { try { const deletedSubmission = await submissions.deleteSubmission(submissionId); console.log("Success! Submission is deleted"); return deletedSubmission; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to void */
Errors

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

Did this help?