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.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function deleteSubmission(
submissionId: string,
options: DeleteSubmissionOptions,
): Promise<void>;
ID of the submission to delete.
Optional fields.
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 */
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.